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

--- Comment #2 from Renlin Li <renlin.li at arm dot com> ---
(In reply to Alan Modra from comment #1)
> 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.

I agree for shared library case.

The behavior I observed here is happening in arm-none-eabi toolchain with
static newlib.

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