]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use version index 1 for defined symbols
authorMichael Matz <matz@suse.de>
Wed, 19 Nov 2025 15:32:51 +0000 (16:32 +0100)
committerMichael Matz <matz@suse.de>
Mon, 24 Nov 2025 14:22:00 +0000 (15:22 +0100)
It's reasonable to use version index 0 for undefined
symbols, so let's continue doing that.  For defined (global)
symbols that aren't otherwise versioned continue using
VER_NDX_GLOBAL (partly reverting behaviour introduced in
commit f685e395).

bfd/
PR ld/33577
* elflink.c (elf_link_output_extsym): Don't set noversion
for defined syms.

ld/
PR ld/33577
* ld-elfvers/vers16.dsym: Add back the "Base" version for
defined syms.

bfd/elflink.c
ld/testsuite/ld-elfvers/vers16.dsym

index b72faff7fd8528c264f7c57764caf4d73b11f777..96497ac1c33d7980e3412dc92d22966b7909caa6 100644 (file)
@@ -11158,13 +11158,7 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
          else
            {
              if (h->verinfo.vertree == NULL)
-               {
-                 iversym.vs_vers = 1;
-                 if (elf_tdata (flinfo->output_bfd)->cverdefs == 0)
-                   /* Defined symbol has no version if there is no
-                      linker version script.  */
-                   noversion = true;
-               }
+               iversym.vs_vers = 1;
              else
                iversym.vs_vers = h->verinfo.vertree->vernum + 1;
              if (flinfo->info->create_default_symver)
index 076d0eb07ed636e7ff0cc505cb3cc34880fdbba3..a32abd7aad93b14c001a302d84652bbbb9651ba9 100644 (file)
@@ -1,2 +1,2 @@
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +(0x[0-9a-f]+ )?_?show_bar
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+( +Base +)? +(0x[0-9a-f]+ )?_?show_bar
 [0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +(0x[0-9a-f]+ )?_?show_foo