This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR target/65248: [5 Regression] Copy relocation in PIE against protected symbol
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 2 Mar 2015 05:36:24 -0800
- Subject: Re: [PATCH] PR target/65248: [5 Regression] Copy relocation in PIE against protected symbol
- Authentication-results: sourceware.org; auth=none
- References: <20150228164223 dot GA22402 at gmail dot com> <CAFULd4Z67Vui4RHD3c07zhBu_1WZ5D2vok5zdw3jzUYCO=OsnA at mail dot gmail dot com>
On Sun, Mar 1, 2015 at 11:48 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Sat, Feb 28, 2015 at 5:42 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> Ue copy relocation in PIE improves performance. But copy relocation
>> can't be used to access protected symbols defined in shared libaries
>> and linker in binutils 2.26 enforces doesn't allow it. GCC doesn't
>> know if an external definition is protected or not. This option adds
>> -mcopyreloc-in-pie to give user an option to turn it off to avoid problem
>> at link-time. OK for trunk?
>
> If the option does not work universally for all cases, then the
> default should be off.
This optimization isn't the real issue. The issue here is protected
symbol in shared library. It can never be referenced from a normal
executable and works correctly, as Alan explained. It doesn't matter
if this option is off or not since it only applies to PIE. You can try
the testcase in PR 65248 without -fPIE -pie.
--
H.J.