This is the mail archive of the 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

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

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

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.


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
> - David
> On Mon, May 1, 2017 at 9:31 AM, Rafael Avila de Espindola
> <> wrote:
>> Where is it documented?
>> Thanks,
>> Rafael
>> David Edelsohn <> 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]