From 1fc0d63775bb93ed295506c4c563b02256fbd6bd Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 28 Mar 2014 21:48:31 +0000 Subject: [PATCH] Debug Compression: Avoid compression debug_frame for now Turns out debug_frame does use multiple fragments, so it doesn't compress correctly with the current approach. Disable compressing it for now while I figure out what's the best solution for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205059 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCContext.cpp | 2 +- test/MC/ELF/compression.s | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp index b228d18ba7f..fdedec1031a 100644 --- a/lib/MC/MCContext.cpp +++ b/lib/MC/MCContext.cpp @@ -253,7 +253,7 @@ getELFSection(StringRef Section, unsigned Type, unsigned Flags, SmallString<32> ZDebugName; if (MAI->compressDebugSections() && Section.startswith(".debug_") && - Section != ".debug_frame") + Section != ".debug_frame" && Section != ".debug_line") Section = (".z" + Section.drop_front(1)).toStringRef(ZDebugName); // Do the lookup, if we have a hit, return it. diff --git a/test/MC/ELF/compression.s b/test/MC/ELF/compression.s index b5ba2624f8a..305a84e1bab 100644 --- a/test/MC/ELF/compression.s +++ b/test/MC/ELF/compression.s @@ -2,14 +2,22 @@ // REQUIRES: zlib -// CHECK: Contents of section .zdebug_line: +// CHECK: Contents of section .debug_line: +// FIXME: Figure out how to handle debug_line that currently uses multiple section fragments +// CHECK-NOT: ZLIB + +// CHECK: Contents of section .zdebug_abbrev: // Check for the 'ZLIB' file magic at the start of the section // CHECK-NEXT: ZLIB + // We shouldn't compress the debug_frame section, since it can be relaxed // CHECK: Contents of section .debug_frame // CHECK-NOT: ZLIB .section .debug_line,"",@progbits + + .section .debug_abbrev,"",@progbits + .byte 1 # Abbreviation Code .text foo: .cfi_startproc -- 2.34.1