[PATCH] ld: Check ELF relocs before allocation

Alan Modra amodra@gmail.com
Wed Dec 29 07:46:26 GMT 2021


On Mon, Dec 27, 2021 at 06:48:33PM -0800, H.J. Lu via Binutils wrote:
> To prepare for DT_RELR implemenation, delay checking ELF relocations
> before allocation so that all input sections have been mapped to output
> sections when relocations are checked.  This is only enabled for x86
> targets.

Please expand on why this is necessary.  "Prepare for DT_RELR
implementation" doesn't tell me much.

Also, it seems to me that you could have made the functional changes
in this patch by implementing an x86 before_allocation routine rather
than introducing a new BFD_JUMP_TABLE_LINK entry.  Doing it that way
would result in a much smaller patch with few if any changes to
generic ELF linker code.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list