[PATCH] D49678: [llvm-objcopy] Adding support for compressed DWARF debug sections.

Puyan Lotfi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 13 14:11:10 PDT 2018


plotfi marked 6 inline comments as done.
plotfi added inline comments.


================
Comment at: tools/llvm-objcopy/Object.cpp:90
+bool SectionBase::isCompressed() const {
+  return Name.startswith(".zdebug") || (Flags & ELF::SHF_COMPRESSED);
+}
----------------
plotfi wrote:
> jakehehrlich wrote:
> > I find it dubious that any notion of "is compressed" should have something to do with the name. Use the flag to determine this and ignore the name,
> But as far as I can tell, Gnu Style uses both the name and the magic string header. I can check for the "ZLIB" magic here too. 
Confirmed, gnu-style uses the ".zdebug" naming prefix instead of the SHF_COMPRESSED flag. 


================
Comment at: tools/llvm-objcopy/Object.cpp:139
   uint8_t *Buf = Out.getBufferStart() + Sec.Offset;
-  std::copy(std::begin(Sec.Contents), std::end(Sec.Contents), Buf);
+  std::copy(std::begin(Sec.OriginalData), std::end(Sec.OriginalData), Buf);
 }
----------------
plotfi wrote:
> jakehehrlich wrote:
> > This is fine as is. Please don't change this.
> Please clarify. When the OriginalData patch lands will this be changed to the right thing?
ETA??


Repository:
  rL LLVM

https://reviews.llvm.org/D49678





More information about the llvm-commits mailing list