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/19636: [x86] Resolve undefweak and defined symbols in executable


On Wed, Feb 24, 2016 at 9:11 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Wed, 24 Feb 2016, H.J. Lu wrote:
>
>> > I can't fathom why anyone would call the above behaviour unexpected or
>> > broken, or would desire the above to _not_ print "works".
>>
>> This is the unintended behavior
>
> Can you cite something to support this statement?  Is everyone here of
> this opinion?
>

Weak symbol was introduced for system libraries.  gABI has "Unresolved
weak symbols have a zero value." and

The behavior of weak symbols in areas not specified by this document
is implementation defined. Weak symbols are intended primarily for use
in system software. Applications using weak symbols are unreliable
since changes in the runtime environment might cause the execution to
fail.

Ld at link-time and ld.so at run-time do want to use vale 0 for unresolved
weak symbols.  We used to treat STB_WEAK differently in ld.so and later
changed to treat STB_WEAK the same as STB_GLOBAL for defined
symbols, i.e. there are no weak defined symbols at run-time.

-- 
H.J.


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