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

Alan Modra amodra@gmail.com
Sun Feb 27 14:01:43 GMT 2022


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.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list