[PATCH] D51841: [llvm-objcopy] Dwarf decompression support.

Puyan Lotfi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 14 09:03:33 PDT 2018


plotfi added inline comments.


================
Comment at: tools/llvm-objcopy/Object.cpp:166
+      isCompressedGnuContents(Sec)
+          ? (strlen("ZLIB") + sizeof(Sec.DecompressedSize))
+          : sizeof(Elf_Chdr_Impl<ELFT>);
----------------
jhenderson wrote:
> As "ZLIB" and its size are used everywhere, I suggest making it a constant global variable that you can query with .size(), as required. (See also my comments elsewhere about making it a uint8_t array/ArrayRef).
I will not use an ArrayRef like that unless I can be convince something like ArrayRef<uint8_t> foo = { 'F', 'O', 'O' } points foo to an allocated array and that "{ 'F', 'O', 'O' }" isn't immediately deallocated. From what I can I have seen, this will not work on clang-8. I will use a std::vector for now. 


Repository:
  rL LLVM

https://reviews.llvm.org/D51841





More information about the llvm-commits mailing list