[PATCH] x86: Cache the symbol table when packing relative relocations
H.J. Lu
hjl.tools@gmail.com
Fri Jan 9 23:53:26 GMT 2026
When packing relative relocations, x86 linker may load the same symbol
table repeatedly, which can take a long time. On Intel Core i7-1195G7
with 32GB RAM, it takes more than 45 minutes to create an output with
-pie -z pack-relative-relocs from an input with 208025 code sections.
Cache the symbol table to reduce the link time to less than 2 seconds.
On the same machine, creating 3.1GB clang executable in LLVM 21.1.3 debug
build:
user 55.39 seconds
system 6.71 seconds
total 65.80 seconds
maximum set(GB) 10.43
page faults 2406941
PR ld/33765
* elfxx-x86.c (elf_x86_relative_reloc_record_add): Remove
keep_symbuf_p.
(_bfd_x86_elf_link_relax_section): Updated. Cache the symbol
table to avoid loading it again.
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-Cache-the-symbol-table-when-packing-relative-rel.patch
Type: text/x-patch
Size: 3752 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20260110/e0d7e9a5/attachment.bin>
More information about the Binutils
mailing list