[PATCH] D59018: [llvm-objcopy] - Fix incorrect CompressedSection creation.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 06:02:58 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf2eb8caa3fbb: [llvm-objcopy] - Fix incorrect CompressedSection creation. (authored by grimar).
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D59018?vs=189469&id=189489#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59018/new/

https://reviews.llvm.org/D59018

Files:
  llvm/tools/llvm-objcopy/ELF/Object.cpp


Index: llvm/tools/llvm-objcopy/ELF/Object.cpp
===================================================================
--- llvm/tools/llvm-objcopy/ELF/Object.cpp
+++ llvm/tools/llvm-objcopy/ELF/Object.cpp
@@ -1111,7 +1111,8 @@
   default: {
     Data = unwrapOrError(ElfFile.getSectionContents(&Shdr));
 
-    if (isDataGnuCompressed(Data) || (Shdr.sh_flags & ELF::SHF_COMPRESSED)) {
+    StringRef Name = unwrapOrError(ElfFile.getSectionName(&Shdr));
+    if (Name.startswith(".zdebug") || (Shdr.sh_flags & ELF::SHF_COMPRESSED)) {
       uint64_t DecompressedSize, DecompressedAlign;
       std::tie(DecompressedSize, DecompressedAlign) =
           getDecompressedSizeAndAlignment<ELFT>(Data);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59018.189489.patch
Type: text/x-patch
Size: 691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190306/39deb7e5/attachment.bin>


More information about the llvm-commits mailing list