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

Puyan Lotfi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 26 15:53:36 PDT 2018


plotfi added inline comments.


================
Comment at: lib/Object/Compressor.cpp:109
+                                        unsigned Alignment, bool Is64Bit) {
+  if (Is64Bit) {
+    // Write Elf64_Chdr header.
----------------
jakehehrlich wrote:
> To further my previous point, if you use an ELFT::Chdr you won't need to check this. That's the general mechanism by which we avoid having to check 64/32 bit and little/big endian. Then you don't need those functions that detect that information. It's far less error prone. 
Could you be more specifc about using  ELFT::Chdr ? Do you think the Compressor should take a template parameter like Elf64_Chdr or Elf32_Chdr and then uses that to write to a buffer? I mainly was looking at the MC ELFWriter::maybeWriteCompression when I wrote some of this stuff FYI. Was planning to eventually clean that code up and have the compressor used by multiple places in LLVM where things are redundant. 


Repository:
  rL LLVM

https://reviews.llvm.org/D49678





More information about the llvm-commits mailing list