[llvm] r305152 - dwarfdump: Handle relocs to zlib (.zdebug*) compressed sections

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 10 12:32:51 PDT 2017


Author: dblaikie
Date: Sat Jun 10 14:32:50 2017
New Revision: 305152

URL: http://llvm.org/viewvc/llvm-project?rev=305152&view=rev
Log:
dwarfdump: Handle relocs to zlib (.zdebug*) compressed sections

Added:
    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-zlib.o.elf-x86-64
Modified:
    llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp
    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc
    llvm/trunk/test/DebugInfo/dwarfdump-zlib.test

Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp?rev=305152&r1=305151&r2=305152&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp Sat Jun 10 14:32:50 2017
@@ -1250,7 +1250,7 @@ DWARFContextInMemory::DWARFContextInMemo
       continue;
 
     RelSecName = RelSecName.substr(
-        RelSecName.find_first_not_of("._")); // Skip . and _ prefixes.
+        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.

Modified: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc?rev=305152&r1=305151&r2=305152&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc (original)
+++ llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc Sat Jun 10 14:32:50 2017
@@ -22,6 +22,7 @@ int main() {
 // $ cp dwarfdump-test-zlib.cc /tmp/dbginfo
 // $ cd /tmp/dbginfo
 // $ clang++ -g dwarfdump-test-zlib.cc -Wl,--compress-debug-sections=zlib -o dwarfdump-test-zlib.elf-x86-64
+// $ clang++ -g dwarfdump-test-zlib.cc -Wa,--compress-debug-sections=zlib -c -o dwarfdump-test-zlib.o.elf-x86-64
 // $ clang++ -g dwarfdump-test-zlib.cc -Wl,--compress-debug-sections=zlib-gnu -o dwarfdump-test-zlibgnu.elf-x86-64
 // llvm-readobj -sections can be used to see that outputs really contain the compressed sections, also output in both
-//   cases is slightly smaller, that is because of compression.
\ No newline at end of file
+//   cases is slightly smaller, that is because of compression.

Added: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-zlib.o.elf-x86-64
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-zlib.o.elf-x86-64?rev=305152&view=auto
==============================================================================
Binary files llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-zlib.o.elf-x86-64 (added) and llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test-zlib.o.elf-x86-64 Sat Jun 10 14:32:50 2017 differ

Modified: llvm/trunk/test/DebugInfo/dwarfdump-zlib.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-zlib.test?rev=305152&r1=305151&r2=305152&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/dwarfdump-zlib.test (original)
+++ llvm/trunk/test/DebugInfo/dwarfdump-zlib.test Sat Jun 10 14:32:50 2017
@@ -1,6 +1,7 @@
 REQUIRES: zlib
 
 RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test-zlib.elf-x86-64 | FileCheck %s
+RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test-zlib.o.elf-x86-64 | FileCheck %s
 RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test-zlibgnu.elf-x86-64 | FileCheck %s
 
 CHECK: .debug_abbrev contents
@@ -10,3 +11,7 @@ CHECK: .debug_abbrev contents
 // that sections names are properly shown in zlib-gnu style (without additional 'z' prefix).
 CHECK: .debug_info contents
 CHECK: 0x00000000: Compile Unit: length = 0x00000144 version = 0x0004 abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x00000148)
+
+// Also check that relocations in the .zdebug sections are handled correctly:
+CHECK: DW_AT_ranges {{.*}} (0x00000000{{$}}
+CHECK-NEXT: [0x




More information about the llvm-commits mailing list