This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Is the AIX available on x86-64? Otherwise it may not be much useful to
refer the linker design. And it is just not linker when it comes to
relocs, it indeed involves entire runtime architecture and ISA of the
platform.

HP-UX on Itanium also uses PIC by default and we have never faced any
such exponential difference between relative and non-relative relocs,
and its been almost 2 decades now.

I just did some numbers. On a Ubuntu 16.10, I just took the ratio of
RELATIVE vs non-RELATIVE on x86-64. I apologize if this number is
already discussed.

readelf -Wr /usr/bin/* 2>&1 | grep RELATIVE | wc -l
1238652

readelf -Wr /usr/bin/* 2>&1 | grep -v RELATIVE | wc -l
51551

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.

At this point, I would say the combination of original ideas proposed
and some work already done in this direction is the way to go. On HP-UX,
our tool chain greatly reduces dyn relocs with IPO kind of options too.

--
Supra


On 01-May-2017 07:43 PM, David Edelsohn wrote:
> GNU ld supports earlier versions of AIX XCOFF, so one can look at that code.
> 
> The current documentation for XCOFF is
> 
> https://www.ibm.com/support/knowledgecenter/ssw_aix_72/com.ibm.aix.files/XCOFF.htm
> 
> - David
> 
> 
> On Mon, May 1, 2017 at 9:31 AM, Rafael Avila de Espindola
> <rafael.espindola@gmail.com> wrote:
>> Where is it documented?
>>
>> Thanks,
>> Rafael
>>
>> David Edelsohn <dje.gcc@gmail.com> writes:
>>
>>> AIX uses relative relocations and generates position independent
>>> executables by default.  The design of the AIX linker might provide
>>> some additional inspiration.
>>>
>>> Thanks, David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]