This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR ld/19579: [Regression] link error linking fortran code with PIE


On Fri, Mar 4, 2016 at 5:52 PM, Alan Modra <amodra@gmail.com> wrote:
> On Fri, Mar 04, 2016 at 05:48:33AM -0800, H.J. Lu wrote:
>> --- a/bfd/elflink.c
>> +++ b/bfd/elflink.c
>> @@ -1172,9 +1172,12 @@ _bfd_elf_merge_symbol (bfd *abfd,
>>
>>    newdef = !bfd_is_und_section (sec) && !bfd_is_com_section (sec);
>>
>> +  /* The old common symbol in executable is a definition if the new
>> +     definition comes from a shared library.  */
>>    olddef = (h->root.type != bfd_link_hash_undefined
>>           && h->root.type != bfd_link_hash_undefweak
>> -         && h->root.type != bfd_link_hash_common);
>> +         && (h->root.type != bfd_link_hash_common
>> +             || (!olddyn && newdyn && bfd_link_executable (info))));
>>
>>    /* NEWFUNC and OLDFUNC indicate whether the new or old symbol,
>>       respectively, appear to be a function.  */
>
> Why is this the correct place to change, and not code after the
> comment "We treat a common symbol as a definition"?
>

olddef has been checked well before that.  We need to get it
right.

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]