aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-09-28 17:11:38 +0930
committerAlan Modra <amodra@gmail.com>2017-09-28 17:36:36 +0930
commit1a3b5c34fe371f618402f811a981839c9191ff9f (patch)
treeaac6ef259428bece256c9ab1fb0e527e363116d1 /bfd
parent50300765aa46894d9347f760fd10dab829d564f7 (diff)
downloadgdb-1a3b5c34fe371f618402f811a981839c9191ff9f.zip
gdb-1a3b5c34fe371f618402f811a981839c9191ff9f.tar.gz
gdb-1a3b5c34fe371f618402f811a981839c9191ff9f.tar.bz2
PR22220, BFD linker wrongly marks symbols as PREVAILING_DEF_IRONLY
non_ir_ref_dynamic wasn't being set in the case where we have a versioned dynamic symbol definition with a non-versioned matching IR symbol. bfd/ PR 22220 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in a case where plugin_notice isn't called. ld/ * testsuite/ld-plugin/pr22220.h, * testsuite/ld-plugin/pr22220lib.cc, * testsuite/ld-plugin/pr22220lib.ver, * testsuite/ld-plugin/pr22220main.cc: New test. * testsuite/ld-plugin/lto.exp: Run it.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1a4bde1..8fca051 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-28 Alan Modra <amodra@gmail.com>
+
+ PR 22220
+ * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
+ a case where plugin_notice isn't called.
+
2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
* elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
diff --git a/bfd/elflink.c b/bfd/elflink.c
index ee5c01f..982bf4f 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1234,6 +1234,16 @@ _bfd_elf_merge_symbol (bfd *abfd,
olddyn = (oldsec->symbol->flags & BSF_DYNAMIC) != 0;
}
+ /* Handle a case where plugin_notice won't be called and thus won't
+ set the non_ir_ref flags on the first pass over symbols. */
+ if (oldbfd != NULL
+ && (oldbfd->flags & BFD_PLUGIN) != (abfd->flags & BFD_PLUGIN)
+ && newdyn != olddyn)
+ {
+ h->root.non_ir_ref_dynamic = TRUE;
+ hi->root.non_ir_ref_dynamic = TRUE;
+ }
+
/* NEWDEF and OLDDEF indicate whether the new or old symbol,
respectively, appear to be a definition rather than reference. */