[BFD][PR21703]Override the new defined symbol with the old normal symbol when --allow-multiple-definition is provided
Alan Modra
amodra@gmail.com
Sat Jul 8 02:11:00 GMT 2017
On Fri, Jul 07, 2017 at 05:41:04PM +0100, Renlin Li wrote:
> diff --git a/bfd/elflink.c b/bfd/elflink.c
> index 471e8ad..e4ab670 100644
> --- a/bfd/elflink.c
> +++ b/bfd/elflink.c
> @@ -1547,6 +1547,17 @@ _bfd_elf_merge_symbol (bfd *abfd,
> sec = *psec;
> }
>
> + /* There are multiple definitions of a normal symbol. */
> + if (olddef && !olddyn && !oldweak && newdef && !newdyn && !newweak
> + && !*matched)
I think !*matched is wrong, and will likely mean the patch doesn't fix
your PR.
> + {
> + /* Handle a multiple definition. */
> + (*info->callbacks->multiple_definition) (info, &h->root,
> + abfd, sec, sym->st_value);
Please use *pvalue here rather than sym->st_value.
> + *skip = TRUE;
> + return TRUE;
> + }
> +
> /* If both the old and the new symbols look like common symbols in a
> dynamic object, set the size of the symbol to the larger of the
> two. */
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list