[PATCH] D76765: [LLD][ELF] - Linkerscript: support the case when INPUT_SECTION_FLAGS is used without section patterns.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 25 10:16:15 PDT 2020


psmith added a comment.

I've made a comment about potentially allowing nested KEEP, although I'm not 100% sure about it. Other than that this looks good.



================
Comment at: lld/ELF/ScriptParser.cpp:702
+        peek() == "INPUT_SECTION_FLAGS"
+            ? readInputSectionDescription(next())
+            : readInputSectionRules(next(), /*withFlags=*/0,
----------------
If I've read this right, this would allow something like:

```
KEEP ( INPUT_SECTION_FLAGS KEEP ( ... ) ) 
```
Although not pretty, perhaps a bool parameter to readInputSectionDescription to say if we are within a KEEP so we can error if we have another. I think the ldgram.y has a separate input_section_no_keep that it uses for this purpose.


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

https://reviews.llvm.org/D76765





More information about the llvm-commits mailing list