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


Nick Clifton <nickc@cygnus.com> writes:

|> Hi Ian,
|> 
|> : Note that we may have some confusion with existing ELF archives in
|> : some scenarios.  Existing ELF archives will have common symbols in the
|> : armap.  We will now wind up pulling those in to satisfy common symbols
|> : in the executable.  I'm not sure what to do about that.  I don't know
|> : how often it will be a real problem.
|> 
|> I think we should be OK.  In the case where old archives are linked
|> with the new linker, we may end up getting bigger than expected
|> executables, but on the other hand we should also end up getting
|> executables that work (becuase they have included the definition of
|> the common as well), instead of ones that are broken.

Unfortunately this will not always work.  Suppose you have a libarary
(call it libgcc.a) that is created with the old ar program (and thus its
armap contains the common symbols).  Suppose further that this library
appears twice on the linker command line (which is always true for
libgcc.a).  The linker will now try to link the object file that contains
the common symbol twice whenever any symbol is referenced from it, which
will fail due to multiple definitions of the other symbols.

Andreas.

-- 
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg

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