Looks we do not really need to apply relocations to .debug_ranges section
when building .gdb_index.
What we need is to scan relocations and take target section indices use addends
as begin/end addresses.
That allows to skip actual relocations computations and speedups building .gdb_index.
When linking llc binary with -gdb-index numbers I got (from 25 runs) were:
- Without this patch: 5,724493319 seconds time elapsed ( +- 0,13% )
- With this path: 5,352222105 seconds time elapsed ( +- 0,10% )
It is about 6.5% speedup.
Any particular reason this would only be done for ranges sections and not for other sections?