aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-01-15 21:17:43 +1030
committerAlan Modra <amodra@gmail.com>2021-01-16 11:11:51 +1030
commiteb6e6af8c17a8f4e120d79cb5f2451ebe60aaf4e (patch)
tree7be44ededf1492bc32581d1d9b13c1531ec255e0 /bfd/elflink.c
parent1368b914e93a3af332f787d3d41c106d11bb90da (diff)
downloadgdb-eb6e6af8c17a8f4e120d79cb5f2451ebe60aaf4e.zip
gdb-eb6e6af8c17a8f4e120d79cb5f2451ebe60aaf4e.tar.gz
gdb-eb6e6af8c17a8f4e120d79cb5f2451ebe60aaf4e.tar.bz2
PR26002 undefined symbol VER_NDX_GLOBAL vs. VER_NDX_LOCAL
This patch makes undefined unversioned dynamic symbols use VER_NDX_GLOBAL (version 1) rather than VER_NDX_LOCAL (version 0). There really isn't much use for an undefined local dynamic symbol, so we may as well use the logically correct value in .gnu.version. https://docs.oracle.com/cd/E26505_01/html/E26506/chapter6-54676.html bfd/ PR 26002 * elflink.c (elf_link_output_extsym): Use version 1 in .gnu.version for undefined unversioned symbols. ld/ PR 26002 * testsuite/ld-elfvers/vers6.dsym: Expect "Base" for undefined unversioned symbols. * testsuite/ld-elfvers/vers16.dsym: Likewise.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index d20857e..8794864 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -10568,7 +10568,7 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
if (h->verinfo.verdef == NULL
|| (elf_dyn_lib_class (h->verinfo.verdef->vd_bfd)
& (DYN_AS_NEEDED | DYN_DT_NEEDED | DYN_NO_NEEDED)))
- iversym.vs_vers = 0;
+ iversym.vs_vers = 1;
else
iversym.vs_vers = h->verinfo.verdef->vd_exp_refno + 1;
}