This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Reducing code size of Position Independent Executables (PIE) by shrinking the size of dynamic relocations section
- From: Florian Weimer <fweimer at redhat dot com>
- To: hegdesmailbox at gmail dot com, David Edelsohn <dje dot gcc at gmail dot com>, Rafael Avila de Espindola <rafael dot espindola at gmail dot com>
- Cc: Binutils Development <binutils at sourceware dot org>, Alan Modra <amodra at gmail dot com>, Cary Coutant <ccoutant at gmail dot com>, Sriraman Tallam <tmsriram at google dot com>, gnu-gabi at sourceware dot org, Xinliang David Li <davidxl at google dot com>, Sterling Augustine <saugustine at google dot com>, Paul Pluzhnikov <ppluzhnikov at google dot com>, Ian Lance Taylor <iant at google dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, Rahul Chaudhry <rahulchaudhry at google dot com>, Luis Lozano <llozano at google dot com>, Peter Collingbourne <pcc at google dot com>, Rui Ueyama <ruiu at google dot com>
- Date: Mon, 1 May 2017 20:35:55 +0200
- Subject: Re: Reducing code size of Position Independent Executables (PIE) by shrinking the size of dynamic relocations section
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E916CC05B1F2
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E916CC05B1F2
- References: <CAGWvnynFwXFGLj3tAVgDatn0zmuHcWHyRNuDvR+wRZCXLnar_A@mail.gmail.com> <8737cosnym.fsf@localhost.localdomain.i-did-not-set--mail-host-address--so-tickle-me> <CAGWvnynEe3QkhDMGc=Tx8Vr44egtv3xLuh1yiVcAhv+e3GLtZg@mail.gmail.com> <a3e5c76c-8cb9-fc53-a30a-96b2c85079e1@gmail.com>
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