bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/21703] The first symbol definition is overwritten by second defi


From: amodra at gmail dot com
Subject: [Bug ld/21703] The first symbol definition is overwritten by second definition when --allow-multiple-definition is provieded
Date: Tue, 04 Jul 2017 00:37:31 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=21703

--- Comment #1 from Alan Modra <amodra at gmail dot com> ---
When you say "the first definition is from the library", I assume you're
talking about a shared library.  If so, a later definition for the same symbol
in a regular object file should replace the shared library definition.  That's
the way ELF shared libraries are supposed to work.  _bfd_elf_merge_symbol ought
to twiddle the symbol to undefined (or new) so that the generic linker will
accept the newly seen regular object file definition.  The result ought to be
the same as when then regular object file definition is seen first.  In that
case a later shared library definition is ignored.

Whether --allow-multiple-definition is given or not should not affect symbol
resolution, just whether an error is reported, as it would be for example when
linking two regular object files each with a definition of the same symbol.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]