Skip to content

Commit ecfaf48

Browse files
committed
[lldb] Remove ELF .zdebug support
clang 14 removed -gz=zlib-gnu support and ld.lld/llvm-objcopy removed zlib-gnu support recently. Remove lldb support by migrating away from llvm::object::Decompressor::isCompressedELFSection. The API has another user llvm-dwp, so it is not removed in this patch. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D129724
1 parent 2f11b3a commit ecfaf48

File tree

3 files changed

+5
-61
lines changed

3 files changed

+5
-61
lines changed

lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,7 @@ lldb::user_id_t ObjectFileELF::GetSectionIndexByName(const char *name) {
16071607
}
16081608

16091609
static SectionType GetSectionTypeFromName(llvm::StringRef Name) {
1610-
if (Name.consume_front(".debug_") || Name.consume_front(".zdebug_")) {
1610+
if (Name.consume_front(".debug_")) {
16111611
return llvm::StringSwitch<SectionType>(Name)
16121612
.Case("abbrev", eSectionTypeDWARFDebugAbbrev)
16131613
.Case("abbrev.dwo", eSectionTypeDWARFDebugAbbrevDwo)
@@ -3365,8 +3365,7 @@ size_t ObjectFileELF::ReadSectionData(Section *section,
33653365
return section->GetObjectFile()->ReadSectionData(section, section_data);
33663366

33673367
size_t result = ObjectFile::ReadSectionData(section, section_data);
3368-
if (result == 0 || !llvm::object::Decompressor::isCompressedELFSection(
3369-
section->Get(), section->GetName().GetStringRef()))
3368+
if (result == 0 || !(section->Get() & llvm::ELF::SHF_COMPRESSED))
33703369
return result;
33713370

33723371
auto Decompressor = llvm::object::Decompressor::create(

lldb/test/Shell/ObjectFile/ELF/compressed-sections.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Sections:
1616
Type: SHT_PROGBITS
1717
Flags: [ SHF_COMPRESSED ]
1818
Content: deadbeefbaadf00d
19+
## The legacy .zdebug format is not supported.
1920
- Name: .zdebug_info
2021
Type: SHT_PROGBITS
2122
Content: 5A4C49420000000000000008789c5330700848286898000009c802c1
@@ -37,8 +38,8 @@ Sections:
3738
# CHECK-NEXT: Data: ()
3839

3940
# CHECK: Name: .zdebug_info
40-
# CHECK: dwarf-info
41+
# CHECK: regular
4142
# CHECK: File size: 28
4243
# CHECK: Data: (
43-
# CHECK-NEXT: 20304050 60708090
44+
# CHECK-NEXT: 5A4C4942 00000000 00000008 789C5330 70084828 68980000 09C802C1
4445
# CHECK-NEXT: )

lldb/test/Shell/SymbolFile/DWARF/x86/gnu-style-compression.yaml

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)