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

  (Sorry about the delay in reply - I have just moved back to the
States and it has taken me a few days to settle in).


: It seems as though to make your test case work we would have to make
: two changes: 1) if a common symbol matches a symbol in the archive
: symbol map, include the element in the link; 2) do not put common
: symbols in the archive symbol map (see compute_and_write_armap in
: archive.c).
: 
: Change 2 seems correct at first glance.  If a library includes
: multiple objects which include a common symbol, we should not put that
: common symbol into the archive symbol map multiple times.  That
: doesn't make sense.
: 
: Given change 2, then change 1 makes some sense.  We will only see a
: symbol in the archive map if it is a definition.  If we have a common
: symbol, we want to bring in a definition.
: 
: I don't have the ELF spec handy.  I don't suppose it says anything
: about this issue?  I also think we must test other ELF systems before
: we should make either change.
: 
: Note that change 2 must not be made for the a.out object file format.
: a.out defines a different, and rather odd, procedure for linking
: against common symbols in archives.  See aout_link_check_ar_symbols in
: aoutx.h.

I think that this is the real problem.  There is no way that we can
know what the target file format is when we are creating the archive,
so we cannot decide whether we should include commons in the symbol
map or not.  (As an aside is there any reason why an archive cannot
contain object file sof multiple file formats ?)

It may be that my original (horrible) patch to the ELF linker is the
only way to solve this one....

Cheers
	Nick

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