This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] x86: Generate PLT relocations for -z now
- From: Florian Weimer <fweimer at redhat dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>, Carlos O'Donell <carlos at redhat dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, binutils at sourceware dot org, GNU C Library <libc-alpha at sourceware dot org>
- Cc: nd at arm dot com
- Date: Wed, 10 May 2017 14:03:34 +0200
- Subject: Re: [PATCH] x86: Generate PLT relocations for -z now
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.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 7740381243
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7740381243
- References: <20170508202153.GA28618@intel.com> <firstname.lastname@example.org> <5911D84A.email@example.com>
On 05/09/2017 04:55 PM, Szabolcs Nagy wrote:
i don't think plt should be considered to be part of the dso abi,
so removing plt relocs should be safe (making a GOT-indirect call
is a valid optimization, since plt is only there for lazy binding
which is an optimization too, gcc can change plt relocs to noplt
ones without -fno-plt so relying on it was never safe).
Sorry, the PLT stubs are for more than just lazy binding. They are also
used by the LD_AUDIT facility. We haven't deprecated that, so we need
to keep supporting it in some way, I think.
Alexander Monakov pointed out to me that ld audit could be fixed
in principle to work with GOT-indirect calls e.g. by generating
its entry point trampolines on the fly.
I think that's true (as long as the existing relocations are expressive
enough). libffi already does that. But it has some implications for
restricted environments which do not allow JIT. We could have some
generic precompiled stub code as part of a file and map that as needed
(with a data mapping right in front of it, containing the parameters),
but I'd rather avoid that complexity.