afa44e
--- binutils.orig/bfd/elflink.c	2022-03-07 14:59:10.275856785 +0000
afa44e
+++ binutils-2.30/bfd/elflink.c	2022-03-07 15:00:19.129562705 +0000
afa44e
@@ -4578,7 +4578,8 @@ error_free_dyn:
afa44e
 		 || h->root.type == bfd_link_hash_warning)
afa44e
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
afa44e
 
afa44e
-	  if (elf_tdata (abfd)->verdef != NULL
afa44e
+	  if (h->versioned != unversioned
afa44e
+	      && elf_tdata (abfd)->verdef != NULL
afa44e
 	      && vernum > 1
afa44e
 	      && definition)
afa44e
 	    h->verinfo.verdef = &elf_tdata (abfd)->verdef[vernum - 1];