This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Allow copy relocations with pie links
- From: Cary Coutant <ccoutant at google dot com>
- To: Cary Coutant <ccoutant at google dot com>, Sriraman Tallam <tmsriram at google dot com>, David Miller <davem at davemloft dot net>, walt at tilera dot com, Doug Kwan <dougkwan at google dot com>, binutils <binutils at sourceware dot org>, Ian Lance Taylor <iant at google dot com>, David Li <davidxl at google dot com>
- Date: Thu, 8 May 2014 23:40:08 -0700
- Subject: Re: Allow copy relocations with pie links
- Authentication-results: sourceware.org; auth=none
- References: <CAAs8HmxwPuH7_s1yLxeW_6qkMCB+_kYSzB6yYG85QZS6yVHpZg at mail dot gmail dot com> <CAHACq4q9qP_h=PuwhJkE6KMt_xf6_Ne3unGRdQpvFqaXL=OxPw at mail dot gmail dot com> <CAAs8HmxkGVYAyq4wf1FChqowmQRTO9POve8Ve5f4kb3DXPfywQ at mail dot gmail dot com> <CAHACq4qx-C-W06-2oYtHz6uVuF3WHyFfp7AO9epk84Y9_6PLOA at mail dot gmail dot com> <20140508231602 dot GC5162 at bubble dot grove dot modra dot org> <CAHACq4oTU7tV+8_5Z_iJ=J2=8tWObXKRP1KL=sSpM-vhbHsnaw at mail dot gmail dot com> <20140509010830 dot GD5162 at bubble dot grove dot modra dot org>
>> 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.
-cary