This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] x86: Generate PLT relocations for -z now
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: 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: Tue, 9 May 2017 15:55:06 +0100
- Subject: Re: [PATCH] x86: Generate PLT relocations for -z now
- Authentication-results: sourceware.org; auth=none
- Authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com;
- Nodisclaimer: True
- References: <20170508202153.GA28618@intel.com> <4867456b-ccf6-11fc-55b3-0e914a8c09c3@redhat.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 09/05/17 15:24, Carlos O'Donell wrote:
> On 05/08/2017 04:21 PM, H.J. Lu wrote:
>>
>> This patch partially reverses:
>>
>> commit 25070364b0ce33eed46aa5d78ebebbec6accec7e
>> Author: H.J. Lu <hjl.tools@gmail.com>
>> Date: Sat May 16 07:00:21 2015 -0700
>>
>> Don't generate PLT relocations for now binding
>>
>> to support LD_AUDIT and LD_PROFILE with -z now. If there is an existing
>> GOT relocation, it is still used to avoid PLT relocation against the same
>> function symbol.
>>
>> Any comments?
> I'm testing this on x86_64 locally to make sure it meets the needs of the
> Fedora and Red Hat users that are actively making use of LD_AUDIT.
>
> Thanks for looking into this and supporting developer tooling that works
> in binutils 2.25, but broke in 2.26 and onwards.
>
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).
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.