This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: GNU-ld behaviour does not match native linker behaviour
- To: nickc at cygnus dot co dot uk
- Subject: Re: GNU-ld behaviour does not match native linker behaviour
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 2 Dec 1999 13:29:29 -0500
- CC: binutils at sourceware dot cygnus dot com
- References: <199912021825.SAA22252@pathia.cygnus.co.uk>
Date: Thu, 2 Dec 1999 18:25:39 GMT
From: Nick Clifton <nickc@cygnus.com>
: You should be able to change the behaviour very easily. In
: elf_link_add_archive_symbols, just before the comment
: /* We need to include this archive member. */
: it checks the symbol in the archive map. Right now it only includes
: the archive member if the symbol is undefined. You should be able to
: change it to include the archive member if the symbol is common.
Well that is what my patch does. But the problem is that we still
only want to include the archive element if it contains the
*definition* of (the contents of) a common symbol, and not just
another (common) declaration of it. Thus the code has to open up the
element, scan its symbol table, determine what kind of declaration of
the symbol this is, and only then can the decision be made as to
whether the element should be included in the link...
That is too horrible. The bug is that ar puts common symbols in the
archive symbol table. Check the behaviour of the Solaris ar program,
and see whether the binutils version acts the same way.
I find it hard to believe that the Solaris linker goes through these
gyrations.
Ian