[binutils-gdb] mips regression fixes

Alan Modra amodra@sourceware.org
Tue Dec 2 00:49:31 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=894024c708c3bdbd75855c4eecc12db583762e83

commit 894024c708c3bdbd75855c4eecc12db583762e83
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Dec 2 10:28:04 2025 +1030

    mips regression fixes
    
    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.

Diff:
---
 bfd/elfxx-mips.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index e37c45fec15..bf2ee4801bb 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -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;


More information about the Binutils-cvs mailing list