[llvm] 08be779 - [DWARF] Remove remnant .zdebug section recognition

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 24 11:07:17 PDT 2023


Author: Fangrui Song
Date: 2023-06-24T11:07:12-07:00
New Revision: 08be7791e195272dca8c9ecb075aa3d86569f9f8

URL: https://github.com/llvm/llvm-project/commit/08be7791e195272dca8c9ecb075aa3d86569f9f8
DIFF: https://github.com/llvm/llvm-project/commit/08be7791e195272dca8c9ecb075aa3d86569f9f8.diff

LOG: [DWARF] Remove remnant .zdebug section recognition

There is a minor behavior difference that is not worth testing for the obsoleted
format. Previously, llvm-dwarfdump considers .zdebug_info as a debug section but
does not decompress it, leading to a warning when the content cannot be parsed.
Now llvm-dwarfdump just ignores the section without a warning.

Added: 
    

Modified: 
    llvm/lib/DebugInfo/DWARF/DWARFContext.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index 122c61fb6941d..33168abbdc386 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -1856,13 +1856,9 @@ class DWARFObjInMemory final : public DWARFObject {
         continue;
       }
 
-      // Compressed sections names in GNU style starts from ".z",
-      // at this point section is decompressed and we drop compression prefix.
-      Name = Name.substr(
-          Name.find_first_not_of("._z")); // Skip ".", "z" and "_" prefixes.
-
       // Map platform specific debug section names to DWARF standard section
       // names.
+      Name = Name.substr(Name.find_first_not_of("._"));
       Name = Obj.mapDebugSectionName(Name);
 
       if (StringRef *SectionData = mapSectionToMember(Name)) {
@@ -1918,11 +1914,9 @@ class DWARFObjInMemory final : public DWARFObject {
                                   RelSecName + "'"));
       }
 
-      RelSecName = RelSecName.substr(
-          RelSecName.find_first_not_of("._z")); // Skip . and _ prefixes.
-
       // TODO: Add support for relocations in other sections as needed.
       // Record relocations for the debug_info and debug_line sections.
+      RelSecName = RelSecName.substr(RelSecName.find_first_not_of("._"));
       DWARFSectionMap *Sec = mapNameToDWARFSection(RelSecName);
       RelocAddrMap *Map = Sec ? &Sec->Relocs : nullptr;
       if (!Map) {


        


More information about the llvm-commits mailing list