[PATCH v2] elf: Cache full internal symbol table for relocatable input

H.J. Lu hjl.tools@gmail.com
Sat Oct 11 06:37:21 GMT 2025


On Sat, Oct 11, 2025 at 9:08 AM Sam James <sam@gentoo.org> wrote:
>
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
> > Add bfd_elf_get_elf_syms_cached to cache internal symbol table for
> > relocatable input and use the internal symbol table cache for both local
> > and global symbols to avoid swapping in the same symbol table repeatedly
> > for --gc-sections.  This improves linker --gc-sections speed by ~2x for
> > PR ld/33530.
> >
> > elf_link_input_bfd is updated to not to pass preallocated buffers to
> > bfd_elf_get_elf_syms_cache.
>
> All tests pass now for me, including:
>
>                 === libctf Summary ===
>
> # of expected passes            39
> # of unsupported tests          1
>
> I'll test it more in the wild tonight and tomorrow.

Here is the v2 patch to keep bfd_elf_get_elf_syms interface unchanged.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2-0001-elf-Cache-full-internal-symbol-table-for-relocata.patch
Type: text/x-patch
Size: 34866 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20251011/095174ab/attachment-0001.bin>


More information about the Binutils mailing list