[lld] lld: add support for NOCROSSREFS(_TO) (PR #95714)
Daniel Thornburgh via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 18 11:27:07 PDT 2024
================
@@ -235,6 +236,32 @@ void ScriptParser::readVersionScriptCommand() {
}
}
+void ScriptParser::readNoCrossRefs(bool to) {
+ expect("(");
+
+ script->noCrossRefLists.push_back({});
+ auto &list = script->noCrossRefLists.back();
+
+ if (to && peek() != ")") {
+ StringRef toSection = next();
+
+ list.toSection = toSection;
+ }
+
+ while (!atEOF() && !errorCount() && peek() != ")") {
+ StringRef section = next();
+
+ list.outputSections.push_back(section);
+ }
+
+ // Discard meaningless lists
+ if ((to && list.outputSections.size() < 1) ||
----------------
mysterymath wrote:
```suggestion
if ((to && list.outputSections.empty()) ||
```
https://github.com/llvm/llvm-project/pull/95714
More information about the llvm-commits
mailing list