[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: |
renlin.li at arm 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 14:14:32 +0000 |
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 ld/21703] New: The first symbol definition is overwritten by second definition when --allow-multiple-definition is provieded, renlin.li at arm dot com, 2017/07/03
- [Bug ld/21703] The first symbol definition is overwritten by second definition when --allow-multiple-definition is provieded, renlin.li at arm dot com, 2017/07/03
- [Bug ld/21703] The first symbol definition is overwritten by second definition when --allow-multiple-definition is provieded, amodra at gmail dot com, 2017/07/03
- [Bug ld/21703] The first symbol definition is overwritten by second definition when --allow-multiple-definition is provieded,
renlin.li at arm dot com <=
- [Bug ld/21703] The first symbol definition is overwritten by second definition when --allow-multiple-definition is provieded, renlin.li at arm dot com, 2017/07/04
- [Bug ld/21703] The first symbol definition is overwritten by second definition when --allow-multiple-definition is provieded, renlin.li at arm dot com, 2017/07/04
- [Bug ld/21703] The first symbol definition is overwritten by second definition when --allow-multiple-definition is provieded, renlin.li at arm dot com, 2017/07/04
- [Bug ld/21703] The first symbol definition is overwritten by second definition when --allow-multiple-definition is provieded, renlin.li at arm dot com, 2017/07/04
- [Bug ld/21703] The first symbol definition is overwritten by second definition when --allow-multiple-definition is provieded, amodra at gmail dot com, 2017/07/04
- [Bug ld/21703] The first symbol definition is overwritten by second definition when --allow-multiple-definition is provieded, renlin.li at arm dot com, 2017/07/05