bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/19842] LTO build fails to write call address for weak symbol r


From: hjl.tools at gmail dot com
Subject: [Bug gold/19842] LTO build fails to write call address for weak symbol reference
Date: Mon, 21 Mar 2016 22:48:23 +0000

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

--- Comment #20 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Cary Coutant from comment #19)
> > commit 3a5dbfb2502e7a49422f13c9cec2becfd46f44f1
> > Author: Alan Modra <address@hidden>
> > Date:   Tue Jun 21 14:55:26 2011 +0000
> >
> >       * elflink.c (_bfd_elf_merge_symbol): Allow type changes for
> >       plugin symbols.  Fix segfault on linker scrip defined syms.
> >
> > has
> >
> >   /* Skip weak definitions of symbols that are already defined.  */
> >   if (newdef && olddef && newweak)
> >     {
> >       /* Don't skip new non-IR weak syms.  */
> >       if (!(oldbfd != NULL
> >             && (oldbfd->flags & BFD_PLUGIN) != 0
> >             && (abfd->flags & BFD_PLUGIN) == 0))
> >         {
> >           newdef = FALSE;
> >           *skip = TRUE;
> >         }
> 
> I don't think this patch is relevant. In the lines you quoted, the
> only change introduced by Alan's patch was to check for oldbfd !=
> NULL.

It is

ommit 35ed3f940bd08e98211807604672cccbf2741d8f
Author: Alan Modra <address@hidden>
Date:   Sun Apr 24 10:02:14 2011 +0000

      PR ld/12365
      PR ld/12696
    include/
      * bfdlink.h (ENUM_BITFIELD): Define.
      (struct bfd_link_hash_entry): Make "type" a bitfield.  Add "non_ir_ref".
      (struct bfd_link_callbacks <notice>): Pass bfd_link_hash_entry pointer
      rather than "name".
    bfd/
      * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Update "notice" call.
      * linker.c (_bfd_link_hash_newfunc): Clear bitfields.
      (_bfd_generic_link_add_one_symbol): Update "notice" call.
      * elflink.c (_bfd_elf_merge_symbol): Don't skip weak redefs when
      it is a redef of an IR symbol in a real BFD.

diff --git a/bfd/elflink.c b/bfd/elflink.c
index 3a4d22c..082355d 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1427,7 +1427,10 @@ _bfd_elf_merge_symbol (bfd *abfd,
   /* Skip weak definitions of symbols that are already defined.  */
   if (newdef && olddef && newweak)
     { 
-      *skip = TRUE;
+      /* Don't skip new non-IR weak syms.  */
+      if (!((oldbfd->flags & BFD_PLUGIN) != 0
+           && (abfd->flags & BFD_PLUGIN) == 0))
+       *skip = TRUE;

       /* Merge st_other.  If the symbol already has a dynamic index,
         but visibility says it should not be visible, turn it into a

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