[PATCH] D71157: [ELF] Refine section group --gc-sections rules to not discard .debug_types

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 00:25:29 PST 2019


grimar accepted this revision.
grimar added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: lld/ELF/InputFiles.cpp:511
+    if (s->flags & SHF_ALLOC)
+      hasAlloc = true;
+  }
----------------
I'd probably simplify:

```
if (InputSectionBase *s = sections[index])
  if (s != &InputSection::discarded && s->flags & SHF_ALLOC)
    hasAlloc = true;
```
Up to you.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71157/new/

https://reviews.llvm.org/D71157





More information about the llvm-commits mailing list