[PATCH x86_64] Optimize access to globals in "-fpie -pie" builds with copy relocations
H.J. Lu
hjl.tools@gmail.com
Wed Feb 4 23:10:00 GMT 2015
On Wed, Feb 4, 2015 at 2:47 PM, Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com> wrote:
> On February 4, 2015 11:37:01 PM GMT+01:00, "H.J. Lu" <hjl.tools@gmail.com> wrote:
>>On Wed, Feb 4, 2015 at 1:53 PM, Sriraman Tallam <tmsriram@google.com>
>>wrote:
>>> On Wed, Feb 4, 2015 at 10:57 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>> On Wed, Feb 4, 2015 at 10:51 AM, Sriraman Tallam
>><tmsriram@google.com> wrote:
>>>>> On Wed, Feb 4, 2015 at 10:45 AM, H.J. Lu <hjl.tools@gmail.com>
>>wrote:
>>>>>> On Wed, Feb 4, 2015 at 10:42 AM, Jakub Jelinek <jakub@redhat.com>
>>wrote:
>>>>>>> On Wed, Feb 04, 2015 at 10:38:48AM -0800, H.J. Lu wrote:
>>>>>>>> Common symbol should be resolved locally for PIE.
>>>>>>>
>>>>>>> binds_local_p yes, binds_to_current_def_p no.
>>>>>>>
>>>>>>
>>>>>> Is SYMBOL_REF_LOCAL_P set to binds_local_p or
>>>>>> binds_to_current_def_p?
>>>>>
>>>>> Looks like binds_local_p:
>>>>>
>>>>> varasm.c:
>>>>> void
>>>>> default_encode_section_info (tree decl, rtx rtl, int first
>>ATTRIBUTE_UNUSED)
>>>>> {
>>>>> ...
>>>>> if (targetm.binds_local_p (decl))
>>>>> flags |= SYMBOL_FLAG_LOCAL;
>>>>>
>>>>
>>>> Why is SYMBOL_REF_LOCAL_P false?
>>>
>>> In varasm.c, default_binds_local_p_1
>>>
>>>
>>> /* Default visibility weak data can be overridden by a strong symbol
>>> in another module and so are not local. */
>>> else if (DECL_WEAK (exp)
>>> && !resolved_locally)
>> ^^^^^^^^^^^^^^^^^^^
>>Why is resolved_locally false? It should be true for common
>>symbol when compiling for PIE.
>>
>>> local_p = false;
>>>
>>> For weak definition, it is set to false here.
>
> Yea and i think this is still wrong and known as
> http://gcc.gnu.org/PR32219
>
Try this.
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr32219.patch
Type: text/x-patch
Size: 887 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150204/bebad606/attachment.bin>
More information about the Gcc-patches
mailing list