Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lld][ELF] Add --debug-names to create merged .debug_names. #86508

Merged
merged 42 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6a046c3
[lld][ELF] Implement merged .debug_names section.
cmtice Mar 25, 2024
46339e6
[lld][ELF] Implement merged .debug_names section.
cmtice Mar 26, 2024
a904174
[lld][ELF] Implement merged .debug_names section.
cmtice Mar 26, 2024
5b7ff5b
[lld][ELF] Implement merged .debug_names section.
cmtice Mar 27, 2024
932aa04
[lld][ELF] Implement merged .debug_names section.
cmtice Mar 27, 2024
2723b34
[lld][ELF] Implement merged .debug_names section
cmtice Mar 27, 2024
64e666a
[lld][ELF] Implement merged .debug_names section.
cmtice Mar 27, 2024
2844418
[lld][ELF] Implement merged .debug_names section.
cmtice Mar 29, 2024
c17e68b
[lld][ELF] Implement merged .debug_names section.
cmtice Mar 29, 2024
c4d7537
[lld][ELF] Implement merged .debug_names section.
cmtice Mar 29, 2024
06171a8
[lld][ELF] Implement merged .debug_names section.
cmtice Mar 29, 2024
11898ca
[lld][ELF] Implement merged .debug_names section.
cmtice Apr 2, 2024
c8b6904
[lld][ELF] Implement merged .debug_names section.
cmtice Apr 2, 2024
e444222
Simplify and optimize .debug_names and removed dead TU code
MaskRay Apr 7, 2024
53b14cd
[lld][ELF] Implement merged .debug_names section.
cmtice Apr 11, 2024
b5732b0
[lld][ELF] Properly handle multiple (appended) indices within single .o
cmtice Apr 14, 2024
5b4566d
[lld][ELF] Add & update tests:
cmtice Apr 14, 2024
8d71288
[lld][ELF] Fix clang-format issues.
cmtice Apr 14, 2024
7607c4d
[lld][ELF] Clean up file & directory names in tests.
cmtice Apr 14, 2024
3721df4
[lld][ELF] Add test for CompUnit > 1
cmtice Apr 15, 2024
174fa5b
[lld][ELF] Clean up updateMultiCuOffset.
cmtice Apr 15, 2024
39b416a
Merge remote-tracking branch 'origin/main' into new-lld-work
cmtice Apr 15, 2024
b57dd7d
Merge branch 'main' into lld-debug-names2
MaskRay Apr 15, 2024
d81d359
writeTo: Use endian::writeNext and rename oldBuf
MaskRay Apr 15, 2024
1660c19
Simplify updateMultiCuOffsets
MaskRay Apr 15, 2024
58e50c2
Merge remote-tracking branch 'maskray/lld-debug-names' into new-lld-work
cmtice Apr 15, 2024
129c09e
[lld][ELF] Minor fixes.
cmtice Apr 15, 2024
932a5c9
Fix when there are more than one name indices in an input .debug_names
MaskRay Apr 15, 2024
18da913
Fix CU list offsets when there are 3+ CUs in one name index
MaskRay Apr 15, 2024
dfe787a
Test compressed input and output
MaskRay Apr 16, 2024
133c19a
[lld][ELF] Add more tests for debug_names.
cmtice Apr 16, 2024
d12762c
Deduplicate tests
MaskRay Apr 16, 2024
fe196b7
[lld][ELF] Minor fixes addressing review comments.
cmtice Apr 17, 2024
cee8c29
[lld][ELF] Fixes to previous fixes.
cmtice Apr 17, 2024
f370080
[lld][ELF] Update code related to type units.
cmtice Apr 17, 2024
ac233d4
Clean up more tests
MaskRay Apr 17, 2024
232c729
Clean up more tests
MaskRay Apr 17, 2024
41580dd
Merge remote-tracking branch 'maskray/lld-debug-names' into new-lld-work
cmtice Apr 17, 2024
254ceed
[lld][ELF] Address last review comments.
cmtice Apr 18, 2024
22f1ef4
[lld][ELF] Clean up error messages.
cmtice Apr 18, 2024
69870a5
Update some diagnostics in readEntry and clang-format
MaskRay Apr 18, 2024
b061f66
[lld][ELF] Tiny cleanups
cmtice Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lld/ELF/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ struct Config {
bool cref;
llvm::SmallVector<std::pair<llvm::GlobPattern, uint64_t>, 0>
deadRelocInNonAlloc;
bool debugNames;
bool demangle = true;
bool dependentLibraries;
bool disableVerify;
Expand Down
1 change: 1 addition & 0 deletions lld/ELF/DWARF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ template <class ELFT> LLDDwarfObj<ELFT>::LLDDwarfObj(ObjFile<ELFT> *obj) {
.Case(".debug_gnu_pubtypes", &gnuPubtypesSection)
.Case(".debug_line", &lineSection)
.Case(".debug_loclists", &loclistsSection)
.Case(".debug_names", &namesSection)
.Case(".debug_ranges", &rangesSection)
.Case(".debug_rnglists", &rnglistsSection)
.Case(".debug_str_offsets", &strOffsetsSection)
Expand Down
4 changes: 4 additions & 0 deletions lld/ELF/DWARF.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ template <class ELFT> class LLDDwarfObj final : public llvm::DWARFObject {
const LLDDWARFSection &getGnuPubtypesSection() const override {
return gnuPubtypesSection;
}
const LLDDWARFSection &getNamesSection() const override {
return namesSection;
}

StringRef getFileName() const override { return ""; }
StringRef getAbbrevSection() const override { return abbrevSection; }
Expand All @@ -87,6 +90,7 @@ template <class ELFT> class LLDDwarfObj final : public llvm::DWARFObject {
LLDDWARFSection infoSection;
LLDDWARFSection lineSection;
LLDDWARFSection loclistsSection;
LLDDWARFSection namesSection;
LLDDWARFSection rangesSection;
LLDDWARFSection rnglistsSection;
LLDDWARFSection strOffsetsSection;
Expand Down
3 changes: 3 additions & 0 deletions lld/ELF/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ static void checkOptions() {
error("-r and -pie may not be used together");
if (config->exportDynamic)
error("-r and --export-dynamic may not be used together");
if (config->debugNames)
ayermolo marked this conversation as resolved.
Show resolved Hide resolved
error("-r and --debug-names may not be used together");
}

if (config->executeOnly) {
Expand Down Expand Up @@ -1234,6 +1236,7 @@ static void readConfigs(opt::InputArgList &args) {
config->cref = args.hasArg(OPT_cref);
config->optimizeBBJumps =
args.hasFlag(OPT_optimize_bb_jumps, OPT_no_optimize_bb_jumps, false);
config->debugNames = args.hasFlag(OPT_debug_names, OPT_no_debug_names, false);
config->demangle = args.hasFlag(OPT_demangle, OPT_no_demangle, true);
config->dependencyFile = args.getLastArgValue(OPT_dependency_file);
config->dependentLibraries = args.hasFlag(OPT_dependent_libraries, OPT_no_dependent_libraries, true);
Expand Down
4 changes: 4 additions & 0 deletions lld/ELF/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ def : Flag<["--"], "no-color-diagnostics">, Alias<color_diagnostics>, AliasArgs<
def cref: FF<"cref">,
HelpText<"Output cross reference table. If -Map is specified, print to the map file">;

defm debug_names: BB<"debug-names",
"Generate a merged .debug_names section",
"Do not generate a merged .debug_names section (default)">;

defm demangle: B<"demangle",
"Demangle symbol names (default)",
"Do not demangle symbol names">;
Expand Down
Loading
Loading