[PATCH v2] elf: Set has_local_dynsyms for forced local symbol

H.J. Lu hjl.tools@gmail.com
Thu Jan 15 04:57:47 GMT 2026


On Thu, Jan 15, 2026 at 10:46 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> Since there are dynamic symbols only if there are dynamic sections,
> assert local dynamic symbol counts only if there are dynamic
> sections.
>

Here is the v2 patch to set has_local_dynsyms to true in
bfd_elf_link_record_dynamic_symbol for forced local symbol
instead.

---
bfd_elf_link_record_dynamic_symbol may be called by mips backend after
a global symbol has been forced to local.  Set has_local_dynsyms to true
in this case.

bfd/

PR ld/33793
* elflink.c (bfd_elf_link_record_dynamic_symbol): Set
has_local_dynsyms to true for forced local symbol.

ld/

PR ld/33793
* testsuite/ld-mips-elf/mips-elf.exp: Run pr33793.
* testsuite/ld-mips-elf/pr33793.d: New file.
* testsuite/ld-mips-elf/pr33793.s: Likewise.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2-0001-elf-Set-has_local_dynsyms-for-forced-local-symbol.patch
Type: text/x-patch
Size: 3427 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20260115/8220272b/attachment.bin>


More information about the Binutils mailing list