Skip to content

Commit 17be909

Browse files
committed
Simplify and optimize .debug_names and removed dead TU code
[ELF] Add --debug-names to create merged .debug_names `clang -g -gpubnames` (with optional -gsplit-dwarf) creates the `.debug_names` section ("per-CU" index). By default lld concatenates input `.debug_names` sections into an output `.debug_names` section. LLDB can consume the concatenated section but the lookup performance is not good. This patch adds --debug-names to create a per-module index by combining the per-CU indexes into a single index that covers the entire load module. The produced `.debug_names` is a replacement for `.gdb_index`. Type units (-fdebug-types-section) are not handled yet. Co-authored-by: Fangrui Song <[email protected]>
1 parent 72f85f0 commit 17be909

18 files changed

+984
-1206
lines changed

lld/ELF/DWARF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ template <class ELFT> LLDDwarfObj<ELFT>::LLDDwarfObj(ObjFile<ELFT> *obj) {
4040
.Case(".debug_gnu_pubtypes", &gnuPubtypesSection)
4141
.Case(".debug_line", &lineSection)
4242
.Case(".debug_loclists", &loclistsSection)
43-
.Case(".debug_names", &debugNamesSection)
43+
.Case(".debug_names", &namesSection)
4444
.Case(".debug_ranges", &rangesSection)
4545
.Case(".debug_rnglists", &rnglistsSection)
4646
.Case(".debug_str_offsets", &strOffsetsSection)

0 commit comments

Comments
 (0)