PR27311 again, ld.bfd (symbol from plugin): undefined reference
authorAlan Modra <amodra@gmail.com>
Wed, 3 Feb 2021 00:27:12 +0000 (10:57 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 3 Feb 2021 02:39:47 +0000 (13:09 +1030)
bfd/
PR 27311
* elflink.c (_bfd_elf_add_default_symbol): Clear override when
undecorated symbol will have a different version.
ld/
* testsuite/ld-ifunc/ifunc.exp (libpr16467b.so, libpr16467bn.so):
Link with --as-needed.

bfd/ChangeLog
bfd/elflink.c
ld/ChangeLog
ld/testsuite/ld-ifunc/ifunc.exp

index d65c56d009bf33133518129ac345e48d50285dea..f76b7a1f264c7dd6ac4183572bec2e1f6a7c58a1 100644 (file)
@@ -1,3 +1,9 @@
+2021-02-03  Alan Modra  <amodra@gmail.com>
+
+       PR 27311
+       * elflink.c (_bfd_elf_add_default_symbol): Clear override when
+       undecorated symbol will have a different version.
+
 2021-02-02  Alan Modra  <amodra@gmail.com>
 
        PR 27311
index 7ac38cac6913c87742a1141216dc9378b5976212..5af32ef0a8139b02ff653ce6440e3e6ab399d2e5 100644 (file)
@@ -1946,12 +1946,16 @@ _bfd_elf_add_default_symbol (bfd *abfd,
          if (hi->verinfo.vertree != NULL && hide)
            {
              (*bed->elf_backend_hide_symbol) (info, hi, TRUE);
+             *override = FALSE;
              goto nondefault;
            }
        }
       if (hi->verinfo.vertree != NULL
          && strcmp (p + 1 + (p[1] == '@'), hi->verinfo.vertree->name) != 0)
-       goto nondefault;
+       {
+         *override = FALSE;
+         goto nondefault;
+       }
     }
 
   if (!*override)
index 450137a1bda896c4ad92c21f00872e54692432a9..e5f9beaabf0b5576b36392a723f63b9573ace99c 100644 (file)
@@ -1,3 +1,8 @@
+2021-02-03  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/ld-ifunc/ifunc.exp (libpr16467b.so, libpr16467bn.so):
+       Link with --as-needed.
+
 2021-02-02  Alan Modra  <amodra@gmail.com>
 
        * testsuite/ld-plugin/pr27311.d,
index 9d3ace6521639383393ad647ad6c63276a806d9e..45b47d7d6a85a456ed52f328d6fded5e1669c02f 100644 (file)
@@ -397,7 +397,7 @@ run_cc_link_tests [list \
     ] \
     [list \
        "Build libpr16467b.so" \
-       "-shared tmpdir/pr16467b.o tmpdir/libpr16467a.so \
+       "-shared -Wl,--as-needed tmpdir/pr16467b.o tmpdir/libpr16467a.so \
         -Wl,--version-script=pr16467b.map" \
        "-fPIC" \
        { dummy.c } \
@@ -422,7 +422,7 @@ run_cc_link_tests [list \
     ] \
     [list \
        "Build libpr16467bn.so" \
-       "-shared tmpdir/pr16467b.o tmpdir/libpr16467an.so \
+       "-shared -Wl,--as-needed tmpdir/pr16467b.o tmpdir/libpr16467an.so \
         -Wl,--version-script=pr16467b.map" \
        "-fPIC" \
        { dummy.c } \