This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [BFD][PR21703]Override the new defined symbol with the old normal symbol when --allow-multiple-definition is provided


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]