From 368dbdd031d76a618bbbd89281489d268c1bc3e9 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Tue, 24 May 2016 12:48:46 +0000 Subject: [PATCH] Recommit r270547 ([llvm-dwarfdump] - Teach dwarfdump to decompress debug sections in zlib style.) Fix was: 1) Had to regenerate dwarfdump-test-zlib.elf-x86-64, dwarfdump-test-zlib-gnu.elf-x86-64 (because llvm-symbolizer-zlib.test uses that inputs for its purposes and failed). 2) Updated llvm-symbolizer-zlib.test (updated used call function address to match new files + added one more check for newly created dwarfdump-test-zlib-gnu.elf-x86-64 binary input). 3) Updated comment in dwarfdump-test-zlib.cc. Original commit message: [llvm-dwarfdump] - Teach dwarfdump to decompress debug sections in zlib style. Before this llvm-dwarfdump only recognized zlib-gnu compression style of headers, this patch adds support for zlib style. It looks reasonable to support both styles for dumping, even if we are not going to suport generating of deprecated gnu one. Differential revision: http://reviews.llvm.org/D20470 llvm-svn: 270557 --- include/llvm/Object/COFF.h | 1 + include/llvm/Object/ELFObjectFile.h | 6 ++ include/llvm/Object/MachO.h | 1 + include/llvm/Object/ObjectFile.h | 6 ++ lib/DebugInfo/DWARF/DWARFContext.cpp | 68 ++++++++++++++---- lib/Object/COFFObjectFile.cpp | 4 ++ lib/Object/MachOObjectFile.cpp | 4 ++ test/DebugInfo/Inputs/dwarfdump-test-zlib.cc | 9 ++- .../Inputs/dwarfdump-test-zlib.elf-x86-64 | Bin 9589 -> 10448 bytes .../Inputs/dwarfdump-test-zlibgnu.elf-x86-64 | Bin 0 -> 10384 bytes test/DebugInfo/dwarfdump-zlib.test | 6 ++ test/DebugInfo/llvm-symbolizer-zlib.test | 7 +- 12 files changed, 92 insertions(+), 20 deletions(-) create mode 100644 test/DebugInfo/Inputs/dwarfdump-test-zlibgnu.elf-x86-64 diff --git a/include/llvm/Object/COFF.h b/include/llvm/Object/COFF.h index 7553f4bdaf7..aa12418f2d3 100644 --- a/include/llvm/Object/COFF.h +++ b/include/llvm/Object/COFF.h @@ -694,6 +694,7 @@ protected: std::error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const override; uint64_t getSectionAlignment(DataRefImpl Sec) const override; + bool isSectionCompressed(DataRefImpl Sec) const override; bool isSectionText(DataRefImpl Sec) const override; bool isSectionData(DataRefImpl Sec) const override; bool isSectionBSS(DataRefImpl Sec) const override; diff --git a/include/llvm/Object/ELFObjectFile.h b/include/llvm/Object/ELFObjectFile.h index c5f777186aa..52cde1a0f0f 100644 --- a/include/llvm/Object/ELFObjectFile.h +++ b/include/llvm/Object/ELFObjectFile.h @@ -222,6 +222,7 @@ protected: std::error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const override; uint64_t getSectionAlignment(DataRefImpl Sec) const override; + bool isSectionCompressed(DataRefImpl Sec) const override; bool isSectionText(DataRefImpl Sec) const override; bool isSectionData(DataRefImpl Sec) const override; bool isSectionBSS(DataRefImpl Sec) const override; @@ -583,6 +584,11 @@ uint64_t ELFObjectFile::getSectionAlignment(DataRefImpl Sec) const { return getSection(Sec)->sh_addralign; } +template +bool ELFObjectFile::isSectionCompressed(DataRefImpl Sec) const { + return getSection(Sec)->sh_flags & ELF::SHF_COMPRESSED; +} + template bool ELFObjectFile::isSectionText(DataRefImpl Sec) const { return getSection(Sec)->sh_flags & ELF::SHF_EXECINSTR; diff --git a/include/llvm/Object/MachO.h b/include/llvm/Object/MachO.h index 611acf3124d..6a079a964bf 100644 --- a/include/llvm/Object/MachO.h +++ b/include/llvm/Object/MachO.h @@ -222,6 +222,7 @@ public: std::error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const override; uint64_t getSectionAlignment(DataRefImpl Sec) const override; + bool isSectionCompressed(DataRefImpl Sec) const override; bool isSectionText(DataRefImpl Sec) const override; bool isSectionData(DataRefImpl Sec) const override; bool isSectionBSS(DataRefImpl Sec) const override; diff --git a/include/llvm/Object/ObjectFile.h b/include/llvm/Object/ObjectFile.h index 0a902a4590a..0f0f10b8c19 100644 --- a/include/llvm/Object/ObjectFile.h +++ b/include/llvm/Object/ObjectFile.h @@ -89,6 +89,7 @@ public: /// @brief Get the alignment of this section as the actual value (not log 2). uint64_t getAlignment() const; + bool isCompressed() const; bool isText() const; bool isData() const; bool isBSS() const; @@ -214,6 +215,7 @@ protected: virtual std::error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const = 0; virtual uint64_t getSectionAlignment(DataRefImpl Sec) const = 0; + virtual bool isSectionCompressed(DataRefImpl Sec) const = 0; virtual bool isSectionText(DataRefImpl Sec) const = 0; virtual bool isSectionData(DataRefImpl Sec) const = 0; virtual bool isSectionBSS(DataRefImpl Sec) const = 0; @@ -380,6 +382,10 @@ inline uint64_t SectionRef::getAlignment() const { return OwningObject->getSectionAlignment(SectionPimpl); } +inline bool SectionRef::isCompressed() const { + return OwningObject->isSectionCompressed(SectionPimpl); +} + inline bool SectionRef::isText() const { return OwningObject->isSectionText(SectionPimpl); } diff --git a/lib/DebugInfo/DWARF/DWARFContext.cpp b/lib/DebugInfo/DWARF/DWARFContext.cpp index d3b5e736c48..27b8c564d91 100644 --- a/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -15,6 +15,7 @@ #include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h" #include "llvm/Support/Compression.h" #include "llvm/Support/Dwarf.h" +#include "llvm/Support/ELF.h" #include "llvm/Support/Format.h" #include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" @@ -590,8 +591,8 @@ DWARFContext::getInliningInfoForAddress(uint64_t Address, return InliningInfo; } -static bool consumeCompressedDebugSectionHeader(StringRef &data, - uint64_t &OriginalSize) { +static bool consumeCompressedGnuHeader(StringRef &data, + uint64_t &OriginalSize) { // Consume "ZLIB" prefix. if (!data.startswith("ZLIB")) return false; @@ -606,6 +607,50 @@ static bool consumeCompressedDebugSectionHeader(StringRef &data, return true; } +static bool consumeCompressedZLibHeader(StringRef &Data, uint64_t &OriginalSize, + bool IsLE, bool Is64Bit) { + using namespace ELF; + uint64_t HdrSize = Is64Bit ? sizeof(Elf64_Chdr) : sizeof(Elf32_Chdr); + if (Data.size() < HdrSize) + return false; + + DataExtractor Extractor(Data, IsLE, 0); + uint32_t Offset = 0; + if (Extractor.getUnsigned(&Offset, Is64Bit ? sizeof(Elf64_Word) + : sizeof(Elf32_Word)) != + ELFCOMPRESS_ZLIB) + return false; + + // Skip Elf64_Chdr::ch_reserved field. + if (Is64Bit) + Offset += sizeof(Elf64_Word); + + OriginalSize = Extractor.getUnsigned(&Offset, Is64Bit ? sizeof(Elf64_Xword) + : sizeof(Elf32_Word)); + Data = Data.substr(HdrSize); + return true; +} + +static bool tryDecompress(StringRef &Name, StringRef &Data, + SmallString<32> &Out, bool ZLibStyle, bool IsLE, + bool Is64Bit) { + if (!zlib::isAvailable()) + return false; + + uint64_t OriginalSize; + bool Result = + ZLibStyle ? consumeCompressedZLibHeader(Data, OriginalSize, IsLE, Is64Bit) + : consumeCompressedGnuHeader(Data, OriginalSize); + + if (!Result || zlib::uncompress(Data, Out, OriginalSize) != zlib::StatusOK) + return false; + + // gnu-style names are started from "z", consume that. + if (!ZLibStyle) + Name = Name.substr(1); + return true; +} + DWARFContextInMemory::DWARFContextInMemory(const object::ObjectFile &Obj, const LoadedObjectInfo *L) : IsLittleEndian(Obj.isLittleEndian()), @@ -631,20 +676,13 @@ DWARFContextInMemory::DWARFContextInMemory(const object::ObjectFile &Obj, name = name.substr(name.find_first_not_of("._")); // Skip . and _ prefixes. - // Check if debug info section is compressed with zlib. - if (name.startswith("zdebug_")) { - uint64_t OriginalSize; - if (!zlib::isAvailable() || - !consumeCompressedDebugSectionHeader(data, OriginalSize)) + bool ZLibStyleCompressed = Section.isCompressed(); + if (ZLibStyleCompressed || name.startswith("zdebug_")) { + SmallString<32> Out; + if (!tryDecompress(name, data, Out, ZLibStyleCompressed, IsLittleEndian, + AddressSize == 8)) continue; - UncompressedSections.resize(UncompressedSections.size() + 1); - if (zlib::uncompress(data, UncompressedSections.back(), OriginalSize) != - zlib::StatusOK) { - UncompressedSections.pop_back(); - continue; - } - // Make data point to uncompressed section contents and save its contents. - name = name.substr(1); + UncompressedSections.emplace_back(std::move(Out)); data = UncompressedSections.back(); } diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp index 4b6ab23f5ff..489c69cc4bc 100644 --- a/lib/Object/COFFObjectFile.cpp +++ b/lib/Object/COFFObjectFile.cpp @@ -292,6 +292,10 @@ uint64_t COFFObjectFile::getSectionAlignment(DataRefImpl Ref) const { return Sec->getAlignment(); } +bool COFFObjectFile::isSectionCompressed(DataRefImpl Sec) const { + return false; +} + bool COFFObjectFile::isSectionText(DataRefImpl Ref) const { const coff_section *Sec = toSec(Ref); return Sec->Characteristics & COFF::IMAGE_SCN_CNT_CODE; diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp index 760249f56a8..d7ec3e57a58 100644 --- a/lib/Object/MachOObjectFile.cpp +++ b/lib/Object/MachOObjectFile.cpp @@ -653,6 +653,10 @@ uint64_t MachOObjectFile::getSectionAlignment(DataRefImpl Sec) const { return uint64_t(1) << Align; } +bool MachOObjectFile::isSectionCompressed(DataRefImpl Sec) const { + return false; +} + bool MachOObjectFile::isSectionText(DataRefImpl Sec) const { uint32_t Flags = getSectionFlags(this, Sec); return Flags & MachO::S_ATTR_PURE_INSTRUCTIONS; diff --git a/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc b/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc index 260c3c435c1..966a465f904 100644 --- a/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc +++ b/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc @@ -16,9 +16,12 @@ int main() { return f(2, 3); } -// Built with Clang 3.2 and ld.gold linker: +// Built with Clang 3.9 and GNU gold (GNU Binutils for Ubuntu 2.26) 1.11: +// Note: llvm-symbolizer-zlib.test relies on the path and filename used ! // $ mkdir -p /tmp/dbginfo // $ cp dwarfdump-test-zlib.cc /tmp/dbginfo // $ cd /tmp/dbginfo -// $ clang++ -g dwarfdump-test-zlib.cc -Wl,--compress-debug-sections=zlib \ -// -o +// $ clang++ -g dwarfdump-test-zlib.cc -Wl,--compress-debug-sections=zlib -o dwarfdump-test-zlib.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 diff --git a/test/DebugInfo/Inputs/dwarfdump-test-zlib.elf-x86-64 b/test/DebugInfo/Inputs/dwarfdump-test-zlib.elf-x86-64 index 16b3153939fa1ba9e4765352951db65620d1c9a1..36e630ccae04100447827945a68491d23da1a256 100755 GIT binary patch literal 10448 zcmeHNYjjlA6+SaJlNZTkKzXBFBnyYsJ7cD?oE2CxOJf#xHJiYa0WrX3 z;Vnqj8qr>1nrNz!lYl0{RjgNmV!ee|h>lTVMwC26iv2~4MO0Pl6de#{Oy=#VhrS-q z)qHXr!iR(e!B^XO7414YlR8 z6&K|cO*aR8=6pVGw2!j0=GO9_&J|uyB!2t5}2EZA_BM@{pOqqf)C}N7z)Z+6hfuP+V zR1~JnUZKo)HMs*pm%r3w4+LBRrc~CKf~!>lVA)%Vt$omXs>_=6rJ@4ORTC5Mv!%10cx z^BVqk_NX6FiMXIgSux*gcZ1?O78hWNci>;$O^`I)zSNH%l^-bIa z_pGrNs3G5sjh`LwgEG+pd}Eg?%~;;)%J9+Uw(tpC$H!-?Ybp=z+m&o#wnO_ZoE$o0 zu&|z&K<}Hztg&T`?U@0N)!K4$f!I2FjkfS7D@N}@Yv|74y1m%YcN~P*@-FHQq8E*3 z;$Ok`THBg0xqywe(BN87 z?D2wQb*~y;1xWWb?`iKDSU_wYH?ff6^9MmMV(cqa=sQyP*(%V9`hzIM)MQ&bY-KM&OT_nF3f8bZ}mpN2^9`3AXH`rB$qShN# z`S9xAaOfLb=V~ziO?U>3B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GPbg)Ily)BQ19hlrvK>Kd4|cG z$90__Rr9WXk<|IKFZ9c|r?9F2mVAzx{p;Ign;oR=Q)LU)z@^LA&deUK>@r(Rt8!&q zGuN6u0kb{ehVN)@Co`kgV)M5!vva)%{Hap*sV#gX6{ASd=5w{$kicv0tuiw!SHBsm z=4LObva17r@tzGvUgbVucD3-kbc++5kfu`A+qKG|`nMfm2Hn`&+zuFnS4Q`M;7!F0 zw;5)J2S*z`448R?(`64dOYH$WSi^IM0Jo>f8&+&~yU(>QtipFhS6G3_foH`@o6Vup z!an8o?NL5`u*U@Tf2rX6EUb(0`%;PC0$SudHRUN35Pr}$y5O63Djez(i+t~;@4!N| zG1QYZdOqmUeA>6l+#x;xiKgY3L&N8gOQ8OH^cKamhXXYJWCe}nTe!-WLIrat#6POH zfCk^yI6xofQUJrbYx5o}0K?o0@oB#-@`MZJXTU@$+W4&n6muiQr+xKR&ZoQ+ji2mD zJ`8-!wU8d(fAc^IO0Vj-=;-ltnBjf{O^HwYbb<5fJ(T*_&VMuKmvV=cFDi+{M_*e0 zHo$OP7+)+k{5`#f^C@qpwvJpsL1>8Pw{w0w=LWnqJ~n3gNrKK_?>|^*c~X>5Sm@gYD5wK--^~=tG@%b z*>Ld7CA_~3@dT~bUaP+cTpS|tDGxCCck(|3E{2-;l&_)x&(MX%Pe*wD)B5Yt^iO%6 zA)FKx?RZHi`B$)s9)CFh!#fbrNmL;o$suTq=2MJcgPZGbuQa##q48L(yM1xS*+D=WtU&;9=zlJ|20e=clp*{CC z`~?a4$2kA#ui;m6zBYa<_=E3<3HU%$N^OGv2RWbY$cZ{{#F3 LN~y-Vw*UVDVc|9? literal 0 HcmV?d00001 diff --git a/test/DebugInfo/dwarfdump-zlib.test b/test/DebugInfo/dwarfdump-zlib.test index cbd85ca093c..d3ef806f3f8 100644 --- a/test/DebugInfo/dwarfdump-zlib.test +++ b/test/DebugInfo/dwarfdump-zlib.test @@ -1,6 +1,12 @@ REQUIRES: zlib RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test-zlib.elf-x86-64 | FileCheck %s +RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test-zlibgnu.elf-x86-64 | FileCheck %s CHECK: .debug_abbrev contents + +// Dump content of a little section to check that both zlib and zlib gnu styles do +// the decompression correctly and result is the same. This and above also checks +// 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) diff --git a/test/DebugInfo/llvm-symbolizer-zlib.test b/test/DebugInfo/llvm-symbolizer-zlib.test index 0aae7e6c692..2860d090eb8 100644 --- a/test/DebugInfo/llvm-symbolizer-zlib.test +++ b/test/DebugInfo/llvm-symbolizer-zlib.test @@ -1,7 +1,10 @@ REQUIRES: zlib -RUN: echo "%p/Inputs/dwarfdump-test-zlib.elf-x86-64 0x400559" > %t.input -RUN: llvm-symbolizer < %t.input | FileCheck %s +RUN: echo "%p/Inputs/dwarfdump-test-zlib.elf-x86-64 0x4005e9" > %t1.input +RUN: llvm-symbolizer < %t1.input | FileCheck %s + +RUN: echo "%p/Inputs/dwarfdump-test-zlibgnu.elf-x86-64 0x4005e9" > %t2.input +RUN: llvm-symbolizer < %t2.input | FileCheck %s CHECK: main CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test-zlib.cc:16