This is the mail archive of the
mailing list for the binutils project.
Re: Reducing code size of Position Independent Executables (PIE) by shrinking the size of dynamic relocations section
- From: Alan Modra <amodra at gmail dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: Cary Coutant <ccoutant at gmail dot com>, binutils <binutils at sourceware dot org>, "H.J. Lu" <hjl dot tools at gmail dot com>, Sterling Augustine <saugustine at google dot com>, Paul Pluzhnikov <ppluzhnikov at google dot com>, Ian Lance Taylor <iant at google dot com>, Xinliang David Li <davidxl at google dot com>, Rahul Chaudhry <rahulchaudhry at google dot com>, Luis Lozano <llozano at google dot com>, Simon Baldwin <simonb at google dot com>
- Date: Wed, 26 Apr 2017 21:41:08 +0930
- Subject: Re: Reducing code size of Position Independent Executables (PIE) by shrinking the size of dynamic relocations section
- Authentication-results: sourceware.org; auth=none
- References: <CAAs8HmwojZTgUL1huLcPp43vb9Nz7fakO=OnY79DCmP5SBZ2ww@mail.gmail.com>
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.
Australia Development Lab, IBM