]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Make readelf not print 'foo@@' for normal symbols
authorMichael Matz <matz@suse.de>
Thu, 20 Nov 2025 14:30:50 +0000 (15:30 +0100)
committerMichael Matz <matz@suse.de>
Mon, 24 Nov 2025 14:22:00 +0000 (15:22 +0100)
when a symbol 'foo' is exported and non-hidden and hence is
available for resolving from other objects it's unreasonable
for readelf to print it as 'foo@@'.  If it's not available
for unversioned resolving because its version is hidden
(but without name), then continue printing it as 'foo@' to
indicate that something special goes on.

binutils/readelf.c
ld/testsuite/ld-elf/pr33599.d

index 633453ae2b21781be897ad46883dfb9a997749fb..425b7b78653a9b8789789a9de66df52f2daab4af 100644 (file)
@@ -14500,8 +14500,8 @@ get_symbol_version_string (Filedata *filedata,
   *sym_info = (vers_data & VERSYM_HIDDEN) != 0 ? symbol_hidden : symbol_public;
   max_vd_ndx = 0;
 
-  /* Return the empty string for the base version.  */
-  if ((vers_data & VERSYM_VERSION) == VERSYM_BASE)
+  /* Return the empty string for the hidden base version.  */
+  if (vers_data == (VERSYM_HIDDEN | VERSYM_BASE))
     return "";
 
   /* Usually we'd only see verdef for defined symbols, and verneed for
index 9a06427aca21e263d7d5c061bab0358ac5e984e0..f3aee6eb11483fa463ba905e0d200fe5969f4348 100644 (file)
@@ -5,7 +5,7 @@
 
 Symbol table '\.dynsym' contains [0-9]+ entries:
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +OBJECT +GLOBAL +DEFAULT +[0-9]+ +bar@@
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +OBJECT +GLOBAL +DEFAULT +[0-9]+ +bar
 #...
  +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo@
 #pass