This is the mail archive of the
mailing list for the binutils project.
Re: Allow copy relocations with pie links
- From: Cary Coutant <ccoutant at google dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Sriraman Tallam <tmsriram 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 12:58:17 -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>
> 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.