From: Alan Modra <amodra@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: [PATCH] bfd: Avoid signed overflow for new_size adjustment
Date: Wed, 7 Dec 2022 09:16:14 +1030 [thread overview]
Message-ID: <Y4/GNhzJCF7aHwR1@squeak.grove.modra.org> (raw)
In-Reply-To: <CAMe9rOqXffjJHb0Rm=jgdGThruJ1o+CpxsRhq9h1J6jEsFrMzA@mail.gmail.com>
On Tue, Dec 06, 2022 at 01:01:42PM -0800, H.J. Lu wrote:
> This doesn't work for 32-bit program since
>
> sizeof (Elf32_External_Chdr) - sizeof (Elf64_External_Chdr);
>
> is negative and will overflow.
>
> We should use
>
> *new_size -= sizeof (Elf64_External_Chdr) - sizeof (Elf32_External_Chdr);
>
> instead.
>
> OK for master?
Yes thanks.
--
Alan Modra
Australia Development Lab, IBM
prev parent reply other threads:[~2022-12-06 22:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 5:03 Get rid of SEC_ELF_RENAME Alan Modra
2022-12-06 21:01 ` [PATCH] bfd: Avoid signed overflow for new_size adjustment H.J. Lu
2022-12-06 22:46 ` Alan Modra [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y4/GNhzJCF7aHwR1@squeak.grove.modra.org \
--to=amodra@gmail.com \
--cc=binutils@sourceware.org \
--cc=hjl.tools@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).