HomePhabricator

[ELF] - Speedup -r and --emit-relocs

Description

[ELF] - Speedup -r and --emit-relocs

This is "Bug 34688 - lld much slower than bfd when linking the linux kernel"

Inside copyRelocations() we have O(N*M) algorithm, where N - amount of
relocations and M - amount of symbols in symbol table. It isincredibly slow
for linking linux kernel.

Patch creates local search tables to speedup.
With this fix link time goes for me from 12.95s to 0.55s what is almost 23x
faster. (used release LLD).

Differential revision: https://reviews.llvm.org/D38129

Details

Committed
grimarSep 27 2017, 2:08 AM
Differential Revision
D38129: [ELF] - Speedup -r and --emit-relocs
Parents
rL314281: [llvm-cov] Improve const-correctness of filters. NFC.
Branches
Unknown
Tags
Unknown