[PATCH] mips: Assert dynamic symbol counts only with dynamic sections

H.J. Lu hjl.tools@gmail.com
Sun Nov 30 07:50:39 GMT 2025


On Sun, Nov 30, 2025 at 11:10 AM Alan Modra <amodra@gmail.com> wrote:
>
> OK.
>

After

commit 54fbc12d6404b645363f901110a21f4410067df5
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Nov 28 16:07:57 2025 +0800

    elf: Renumber local dynamic symbols only if needed

mips-linux got

FAIL: MIPS magic __ehdr_start symbol test 1 (o32)
FAIL: PR ld/21334 MIPS GOT16 relocation in static binary

with assertion failures on

BFD_ASSERT (hsd.max_local_dynindx <= htab->root.local_dynsymcount + 1);

Since there are dynamic symbols only if there are dynamic sections,
assert dynamic symbol counts only if there are dynamic sections.

* elfxx-mips.c (mips_elf_sort_hash_table): Assert dynamic symbol
counts only if there are dynamic sections.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mips-Assert-dynamic-symbol-counts-only-with-dynamic-.patch
Type: text/x-patch
Size: 2358 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20251130/478ea124/attachment.bin>


More information about the Binutils mailing list