aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-06-28 08:08:04 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-06-28 08:08:30 -0700
commitf4ab0e2d1d4e14cfdddf46ac846c48ae55f4e14a (patch)
treed2afef7558477e2ddbc901c3170a3a0278b61b75 /bfd
parent1b857aeed3f5cfddc4b5b1f5836ccd341aeb9f5d (diff)
downloadgdb-f4ab0e2d1d4e14cfdddf46ac846c48ae55f4e14a.zip
gdb-f4ab0e2d1d4e14cfdddf46ac846c48ae55f4e14a.tar.gz
gdb-f4ab0e2d1d4e14cfdddf46ac846c48ae55f4e14a.tar.bz2
Skip version check for unreferenced and undefined symbol
No need to check version if symbol is unreferenced and undefined. bfd/ PR ld/20306 * elflink.c (elf_link_check_versioned_symbol): Return false for unreferenced undefined symbol. ld/testsuite/ * testsuite/ld-gc/gc.exp: Run pr20306 test. * ld-gc/pr20306.c: New file. * ld-gc/pr20306.d: Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 8ad7d0d..9e2534e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2016-06-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/20306
+ * elflink.c (elf_link_check_versioned_symbol): Return false
+ for unreferenced undefined symbol.
+
2016-06-28 Nick Clifton <nickc@redhat.com>
* elf32-bfin.c (bfin_adjust_dynamic_symbol): Fail if a COPY reloc
diff --git a/bfd/elflink.c b/bfd/elflink.c
index ad8493b..3e24940 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -9053,7 +9053,8 @@ elf_link_check_versioned_symbol (struct bfd_link_info *info,
case bfd_link_hash_undefined:
case bfd_link_hash_undefweak:
abfd = h->root.u.undef.abfd;
- if ((abfd->flags & DYNAMIC) == 0
+ if (abfd == NULL
+ || (abfd->flags & DYNAMIC) == 0
|| (elf_dyn_lib_class (abfd) & DYN_DT_NEEDED) == 0)
return FALSE;
break;