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.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to