This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -llibrary's position in ld cause with -static
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Zhang Le <ejoy at xinhuanet dot com>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 10 Sep 2003 16:41:04 +0930
- Subject: Re: -llibrary's position in ld cause with -static
- References: <mutt.200309092154.42@peoplemail.com.cn>
On Tue, Sep 09, 2003 at 10:02:45PM +0800, Zhang Le wrote:
> Could you give me a explanation of this behavior?
Extract from ld.info:
The linker will search an archive only once, at the location where it is
specified on the command line. If the archive defines a symbol which
was undefined in some object which appeared before the archive on the
command line, the linker will include the appropriate file(s) from the
archive. However, an undefined symbol in an object appearing later on
the command line will not cause the linker to search the archive again.
--
Alan Modra
IBM OzLabs - Linux Technology Centre