--as-needed change wrt undefined weak symbols
Alan Modra
amodra@gmail.com
Fri Apr 5 01:07:00 GMT 2013
On Thu, Apr 04, 2013 at 04:11:54PM -0700, H.J. Lu wrote:
> It is resolved to either 0, if it is undefined, or its PLT entry, if
> it is defined. Once it is resolved to 0 at link-time, change to
> defined at run-time won't affect executable. If it is resolved
> to defined at link-time, change it to undefined at run-time
> will lead to seg-fault.
Yes, that is a problem with any target that resolves function
addresses to a PLT entry. For such targets, this is generally true
for any usage of weak functions in a non-PIC executable. In other
words, the problem you raise here is entirely orthogonal to
--as-needed behaviour.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list