]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
mips regression fixes
authorAlan Modra <amodra@gmail.com>
Mon, 1 Dec 2025 23:58:04 +0000 (10:28 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 2 Dec 2025 00:31:30 +0000 (11:01 +1030)
Commit 54fbc12d64 introduced mips-linux testsuite regressions.
+FAIL: MIPS magic __ehdr_start symbol test 1 (o32)
+FAIL: PR ld/21334 MIPS GOT16 relocation in static binary
+FAIL: PR ld/21375 in SVR4 executable (hidden)
These are all assertion failures in mips_elf_sort_hash_table
  BFD_ASSERT (hsd.max_local_dynindx <= htab->root.local_dynsymcount + 1);

This was a pre-existing problem exposed by commit 54fbc12d64.

* elfxx-mips.c (mips_elf_sort_hash_table): Properly test for
no dynsyms.

bfd/elfxx-mips.c

index e37c45fec15dc00ccbf254332c48cd50ad8bf843..bf2ee4801bb725ca8baadd175c23357289ddb8d3 100644 (file)
@@ -4005,7 +4005,7 @@ mips_elf_sort_hash_table (bfd *abfd, struct bfd_link_info *info)
   htab = mips_elf_hash_table (info);
   BFD_ASSERT (htab != NULL);
 
-  if (htab->root.dynsymcount == 0)
+  if (htab->root.dynsymcount <= 1)
     return true;
 
   g = htab->got_info;