This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: behavior of weak definitions in archive libraries
- From: David Mosberger <davidm at napali dot hpl dot hp dot com>
- To: Ian Lance Taylor <ian at wasabisystems dot com>
- Cc: davidm at hpl dot hp dot com, binutils at sources dot redhat dot com,eranian at napali dot hpl dot hp dot com
- Date: Tue, 11 Nov 2003 15:11:58 -0800
- Subject: Re: behavior of weak definitions in archive libraries
- References: <16305.24047.745847.177816@napali.hpl.hp.com><m3wua6pmbj.fsf@gossamer.airs.com>
- Reply-to: davidm at hpl dot hp dot com
>>>>> On 11 Nov 2003 17:33:36 -0500, Ian Lance Taylor <ian@wasabisystems.com> said:
Ian> This behaviour is intentional for ELF. That is how ELF linkers work.
>> From http://www.caldera.com/developers/gabi/1998-04-29/ch4.symtab.html
Ian> When the link editor searches archive libraries [see ``Archive
Ian> File'' in Chapter 7], it extracts archive members that contain
Ian> definitions of undefined global symbols. The member's definition
Ian> may be either a global or a weak symbol. The link editor does not
Ian> extract archive members to resolve undefined weak symbols.
Ian> Unresolved weak symbols have a zero value.
I guess I can see why doing it the other way would come with its own
set of problems. Nasty...
OK, so the bug must be in the library then.
Thanks for quick response!
--david