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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 10 10:06:03 PDT 2018


ruiu added inline comments.


================
Comment at: ELF/Driver.cpp:1314
+  } else if (Config->Strip == StripPolicy::DebugNonLine) {
+    llvm::erase_if(InputSections, [](InputSectionBase *S) {
+      return StringSwitch<bool>(S->Name)
----------------
grimar wrote:
> 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.
It's because just a blacklist is easier to understand than a mix of blacklist/whitelist.


================
Comment at: ELF/Driver.cpp:507
     return StripPolicy::All;
-  return StripPolicy::Debug;
+  else if (Arg->getOption().getID() == OPT_strip_debug)
+    return StripPolicy::Debug;
----------------
nit: no `else` after `return`.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D46628





More information about the llvm-commits mailing list