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

Florian Weimer fweimer@redhat.com
Mon May 1 18:36:00 GMT 2017


On 05/01/2017 08:28 PM, Suprateeka R Hegde wrote:
> So the ratio shows ~96% is RELATIVE reloc. And only ~4% others. This is
> not the case on HP-UX/Itanium. But as I said, this comparison does not
> make sense as the runtime architecture and ISA are totally different.

It could be that HP-UX was written in a way to reduce relative 
relocations, or that the final executables aren't actually PIC anymore. 
The amount of C++ code with large vtables could differ as well.

Here's a GCC extension proposed which is relevant to producing fully 
relocatable code with fewer relative relocations:

   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38295

Florian



More information about the Binutils mailing list