aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-06-14 05:37:19 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-06-14 05:37:33 -0700
commit1f6f5dba57ffbc073b1ead89647288feaaed2caf (patch)
treeabea3a9c90a1731dbd1cc39843491f6d5e2d7995 /bfd
parent7b045207d1b8980add1c87b643504e3ef987e7a2 (diff)
downloadgdb-1f6f5dba57ffbc073b1ead89647288feaaed2caf.zip
gdb-1f6f5dba57ffbc073b1ead89647288feaaed2caf.tar.gz
gdb-1f6f5dba57ffbc073b1ead89647288feaaed2caf.tar.bz2
elf: Check if the first symbol version is base version
Check VER_FLG_BASE instead of assuming that the first symbol version is base version. bfd/ PR binutils/23267 * elf.c (_bfd_elf_get_symbol_version_string): Check if the first symbol version is base version. binutils/ PR binutils/23267 * readelf.c (get_symbol_version_string): Check if the first symbol version is base version.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2aa411d..06498a5 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2018-06-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/23267
+ * elf.c (_bfd_elf_get_symbol_version_string): Check if the first
+ symbol version is base version.
+
2018-06-14 Alan Modra <amodra@gmail.com>
* elf-bfd.h (struct elf_link_hash_table): Add "dynamic_relocs".
diff --git a/bfd/elf.c b/bfd/elf.c
index 6c66bbc..0f75375 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1865,7 +1865,10 @@ _bfd_elf_get_symbol_version_string (bfd *abfd, asymbol *symbol,
if (vernum == 0)
version_string = "";
- else if (vernum == 1)
+ else if (vernum == 1
+ && (vernum > elf_tdata (abfd)->cverdefs
+ || (elf_tdata (abfd)->verdef[0].vd_flags
+ == VER_FLG_BASE)))
version_string = "Base";
else if (vernum <= elf_tdata (abfd)->cverdefs)
version_string =