Allow copy relocations with pie links

David Miller davem@davemloft.net
Tue May 13 04:25:00 GMT 2014


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.



More information about the Binutils mailing list