[PATCH] D46628: [ELF] Add --strip-debug-non-line option

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 10 03:26:50 PDT 2018


grimar added a comment.

In https://reviews.llvm.org/D46628#1094011, @modocache wrote:

> Thanks for the review! I adopted the changes you suggested. As for validating the debug info, what about using 'llvm-dwarfdump -verify'? In fact running that on the output of this new option resulted in errors, so I'll address those.


I like the idea. In theory output after this patch is valid, right? (it produce the valid set of DWARF sections), so I think llvm-dwarfdump just should not report any errors probably for this case.



================
Comment at: ELF/Driver.cpp:1314
+  } else if (Config->Strip == StripPolicy::DebugNonLine) {
+    llvm::erase_if(InputSections, [](InputSectionBase *S) {
+      return StringSwitch<bool>(S->Name)
----------------
ruiu wrote:
> Do you think you can make a list of sections you want to strip, instead of making a list of sections you want to keep?
Rui, why? I think this should be a whitelist. DWARF can add new debug sections,
but linker should just keep the sections that allow to "map program counter values to line
numbers". It's whitelist behavior.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D46628





More information about the llvm-commits mailing list