This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Allow copy relocations with pie links
- From: David Miller <davem at davemloft dot net>
- To: tmsriram at google dot com
- Cc: ccoutant at google dot com, walt at tilera dot com, dougkwan at google dot com, binutils at sourceware dot org, iant at google dot com, davidxl at google dot com
- Date: Tue, 13 May 2014 00:24:56 -0400 (EDT)
- Subject: Re: Allow copy relocations with pie links
- Authentication-results: sourceware.org; auth=none
- References: <20140509010830 dot GD5162 at bubble dot grove dot modra dot org> <CAHACq4r0jZsfo6WZznFjSibBGLtPs=WXrme+0LWgomrmWgTEOg at mail dot gmail dot com> <CAAs8Hmy6KkPCA-dczbDPMObpDi8HBZXy87pgbLdqbwAQn-rSxA at mail dot gmail dot com>
From: Sriraman Tallam <tmsriram@google.com>
Date: Fri, 9 May 2014 11:57:23 -0700
> On Thu, May 8, 2014 at 11:40 PM, Cary Coutant <ccoutant@google.com> wrote:
>>>> What should this code do, then? Add a COPY reloc only for
>>>> position-dependent executables?
>>>
>>> Yes. If we're building a PIE then we should be using -fpic/PIC
>>> compiled code and won't have the relocs that would hit this code. If
>>> we do try to build a PIE with non-PIC code, then we'll get dynamic
>>> relocs in text. Enabling copy relocs for PIEs would still give
>>> us DT_TEXTREL. (Of course, ppc64 gcc is PIC by default, so the
>>> foregoing mostly applies to ppc32.)
>>
>> OK, thanks. Sri, both locations in powerpc.cc should use the test
>> !output_is_position_independent(). That will leave powerpc functioning
>> exactly as before.
>
> Changed and patch attached.
No regressions on sparc.