[PATCH 2/2] ELF32: don't silently truncate relocation addends

Jan Beulich jbeulich@suse.com
Mon Feb 28 07:21:43 GMT 2022


On 27.02.2022 15:01, Alan Modra wrote:
> On Fri, Feb 25, 2022 at 12:20:50PM +0100, Jan Beulich wrote:
>> At least x86-64's x32 sub-mode and RISC-V's 32-bit mode calculate
>> addends as 64-bit values, but store them in signed 32-bit fields when
>> generating the file without encountering any earlier error. When the
>> relocated field is a 64-bit one, the value resulting after processing
>> the relocation record when linking (or the latest when loading) may
>> thus be wrong due to the truncation.
> 
> The patch causes regressions on cris, h8300, mips, and nios2.

Oh, I see. I'll look into that, and I should have clarified that just
like for "gas: retain whitespace between strings" I didn't do a wide
test run just yet (should have marked the one here "partly RFC" as well,
I guess). I'm sorry if this has caused you doing extra work.

Jan



More information about the Binutils mailing list