bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/24267] ld discards a symbol with -flto and -static


From: hjl.tools at gmail dot com
Subject: [Bug ld/24267] ld discards a symbol with -flto and -static
Date: Thu, 28 Feb 2019 12:51:56 +0000

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

--- Comment #12 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Martin Liška from comment #11)
> I've got a patch candidate that can solve it:
> 
> diff --git a/bfd/coffgen.c b/bfd/coffgen.c
> index 309e1249ac..1d200b066b 100644
> --- a/bfd/coffgen.c
> +++ b/bfd/coffgen.c
> @@ -2678,9 +2678,9 @@ _bfd_coff_section_already_linked (bfd *abfd,
>        and match any comdat section with comdat name of <key>, and
>        any linkonce section with the same suffix, ie.
>        .gnu.linkonce.*.<key>.  */
> -      if (((s_comdat != NULL) == (l_comdat != NULL)
> -        && strcmp (name, l->sec->name) == 0)
> -       || (l->sec->owner->flags & BFD_PLUGIN) != 0)
> +      if (((s_comdat != NULL) == (l_comdat != NULL))
> +          && ((strcmp (name, l->sec->name) == 0)
> +            || (l->sec->owner->flags & BFD_PLUGIN) != 0))
>       {
>         /* The section has already been linked.  See if we should
>            issue a warning.  */
> 
> However, Honza is still thinking that LDPR_PREVAILING_DEF_IRONLY should be
> used for the symbol. If I see correctly it's set in ld/plugin.c base on
>  else if (owner_sec->owner == abfd).

What do ELF linkers (gold and bfd) get?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]