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


Hi Ian,

: 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.

Hmm, this may well be the case.  The customer who originally reported
this problem also had this to say:

: You should note something I find REALLY curious.  On HP,
: I get the correct, expected, behaviour if I use /bin/ar
: to create the fortran-code archive library.  However, if
: I use the gnu ar to create the archive - I then get the
: same incorrect behaviour I am seeing on Solaris and Linux.
: So could the gnu ar be somehow incorrectly marking something
: having to do with bkldta in the archive index?  Remember that
: we use the native ld on HP.
: 
: On Solaris I tried the same test, /usr/ccs/bin/ar vs. gnu ar.
: Didn't change anything, even if I used the native compiler
: to link.

Presumably what should happen is that AR should only put a common
symbol into its archive symbol table if the symbol is the definition
of a common and not just another reference to it.  The the linker
would know to link in that element.

I will have a look at fixing AR shortly.

Cheers
	Nick

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