This is the mail archive of the binutils@sourceware.cygnus.com 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]

Re: GNU-ld behaviour does not match native linker behaviour


   Date: Thu, 2 Dec 1999 12:08:50 GMT
   From: Nick Clifton <nickc@cygnus.com>

     It has been brought to my attention that GNU-ld does not handle
     commons in libraries in the same way as SUN's or HP's linkers handle
     them.

   So - which linker is doing the right thing ?

I don't know.  I thought the GNU linker behaved the same as the
Solaris linker.  I remember testing it.  But perhaps I screwed up, or
perhaps the Solaris linker changed its behaviour.

It's hard to know what to do with common symbols, because they do not
have clearly defined semantics.  Different people have different
expectations of them.

Is it possible for you check an SVR4 or Unixware system?

   I have a patch to change the behaviour of GNU-ld, although it is
   rather cumbersome, but I do not know if I should even submit it, since
   I am not at all sure that GNU-ld is doing the wrong thing.

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.

Ian

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