1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

dwarfdump: Handle relocs to zlib (.zdebug*) compressed sections

llvm-svn: 305152
This commit is contained in:
David Blaikie 2017-06-10 19:32:50 +00:00
parent b853a29964
commit 2e56d82e9d
4 changed files with 8 additions and 2 deletions

View File

@ -1250,7 +1250,7 @@ DWARFContextInMemory::DWARFContextInMemory(const object::ObjectFile &Obj,
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.

View File

@ -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.
// cases is slightly smaller, that is because of compression.

Binary file not shown.

View File

@ -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