[PATCH] D38491: [ELF] Decompress debug info sections early

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 02:07:19 PDT 2017


grimar added inline comments.


================
Comment at: ELF/GdbIndex.cpp:38
+      if (Decompressor::isCompressedELFSection(Sec->Flags, Sec->Name))
+        Sec->uncompress();
       M->Data = toStringRef(Sec->Data);
----------------
We call `decompressAndMergeSections` at some point in linker, and at first I thought that better would be to just call it earlier or at least to decompress sections early, but that is not so convinent to do. Assuming we still want to use threading for that it is more convinent to do when we have full list of input sections, like now.

And here `uncompress` is used for few sections in a single file and only when we reporting errors. That is probably looks fine for me.


================
Comment at: test/ELF/compressed-debug-conflict.test:77
+    Content:         ''
+  - Name:            .debug_macinfo
+    Type:            SHT_PROGBITS
----------------
I am pretty sure you should not need this and few other sections, symbols and relocations. Testcase can be reduced.
Though I would suggest not to use yaml2obj here, but use asm input instead. Just like we usually do (see compressed-debug-input.s, gdb-index-empty.s for example). Doing that should simplify testcase a lot.


https://reviews.llvm.org/D38491





More information about the llvm-commits mailing list