This is the mail archive of the
mailing list for the binutils project.
Re: Allow copy relocations with pie links
- From: Sriraman Tallam <tmsriram at google dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail 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 13:57:09 -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> <CAMe9rOqFiwXw3G=zFvWq4o27OGXss2RiyZMUKOqzxE8_eFxnaw at mail dot gmail dot com> <CAHACq4rdUe4_Rhj8vwA0=NU6O3WTOR84HQJKqB8AiSi25N4pgA at mail dot gmail dot com>
On Thu, May 8, 2014 at 12:58 PM, Cary Coutant <email@example.com> wrote:
>> x86 doesn't have PC-relative data access. x86 needs
>> to use GOT for all data access in PIE unless run-time
>> text relocation is allowed. Normally x86 shouldn't have
>> copy relocation in PIE.
> Right. With Sri's test case, we get an absolute R_386_32 relocation
> for the access, and the DT_TEXTREL flag is set in the PIE binary
> because of the text relocation. There is no COPY relocation. Since we
> had a path in the code to check for copy relocs for the PC-relative
> relocations, I think it makes sense to adjust the test there, though.
It took me a while to understand this discussion. I think I get it
now, it looks like there is no need for me to change i386.cc as no
data access can produce a pc relative relocation. Cary, how do I
think I should adjust the test? The test itself passes on i386 even
without the change.