This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Remove support for legacy .zdebug sections
ClosedPublic

Authored by MaskRay on Jun 1 2022, 10:02 AM.

Details

Summary

.zdebug is unlikely used any longer: gcc -gz switched from legacy
.zdebug to SHF_COMPRESSED with binutils 2.26 (2016), which has been
several years. clang 14 dropped -gz=zlib-gnu support. According to
Debian Code Search (gz=zlib-gnu), no project uses -gz=zlib-gnu.

Remove .zdebug support to (a) simplify code and (b) allow removal of llvm-mc's
--compress-debug-sections=zlib-gnu.

Diff Detail

Event Timeline

MaskRay created this revision.Jun 1 2022, 10:02 AM
Herald added a reviewer: ctetreau. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
MaskRay requested review of this revision.Jun 1 2022, 10:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 10:02 AM
peter.smith accepted this revision.Jun 1 2022, 10:30 AM

I'm happy with removing given that there is an official ELF replacement. Will be worth waiting a bit of time before committing to see if there are any last minute objections.

lld/ELF/InputSection.cpp
73–75

Possibly worth a warning message if a section prefix of .zebug is encountered? For example:

LLD does not support legacy .zdebug compressed debug sections produced with -gz=zlib-gnu. Please rebuild with -gz=zlib.
This revision is now accepted and ready to land.Jun 1 2022, 10:30 AM
MaskRay added inline comments.Jun 1 2022, 10:32 AM
lld/ELF/InputSection.cpp
73–75

I have thought about this, but removing .zdebug check is desired: this avoids a section name read when creating input sections.

This revision was automatically updated to reflect the committed changes.
lld/test/ELF/compressed-debug-input.s