Reducing code size of Position Independent Executables (PIE) by shrinking the size of dynamic relocations section

Alan Modra amodra@gmail.com
Wed Apr 26 12:11:00 GMT 2017


On Mon, Apr 24, 2017 at 05:22:00PM -0700, Sriraman Tallam via binutils wrote:
> All of these extra dynamic
> relocations are of the ELF type R_X86_64_RELATIVE.

I've noticed that RELATIVE relocs often apply to a run of consecutive
addresses.  You would probably see quite good compression by simply
defining a new reloc to add the base address to an array of words.
The size of the array could be specified by r_addend, r_sym, or
r_type.  (In the latter case you'd be defining a series of relocs).
I think the best choice would be to use r_addend.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list