[PATCH] D54361: [ELF] .gdb_index: fix CuOff when a .debug_info section more than 1 CU

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 9 19:28:39 PST 2018


dblaikie added a comment.

I think this would fail at least in the following example:

- Compile one file with gnu-pubnames and one withou
- ld -r the two together (non-pubnames first, then pubnames one)
- link those

I believe that'll produce a different (& incorrect) gdb-index compared to skipping the -r step and linking the two objects directly, maybe? (I haven't looked at the code carefully/completely enough to understand the CU counting aspect - but suffice to say, the linker shouldn't assume there are as many gnu_pubnames contributions/sets as there are CUs - or that they're in the same order, for that matter)

Probably the right solution is to store the Offset (DWARFDebugPubTable::Set::Offset) that describes the CU from the pubnames - then lookup that offset to determine the CU index - possibly by a search within a sorted list of CU offsets, built by a walk of the CUs in the input)


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D54361





More information about the llvm-commits mailing list