[lld] lld: add support for NOCROSSREFS(_TO) (PR #95714)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 17 11:01:12 PDT 2024


================
@@ -235,6 +236,21 @@ void ScriptParser::readVersionScriptCommand() {
   }
 }
 
+void ScriptParser::readNoCrossRefs(bool to) {
+  expect("(");
+
+  script->nocrossrefs.push_back({});
+
+  script->nocrossrefs.back().firstOnly = to;
+
+  while (!atEOF() && !errorCount() && peek() != ")") {
+    StringRef section = next();
----------------
smithp35 wrote:

Do we do any checking that the token is a valid OutputSection name?

Although not possible at this point, it may be worth validating that the names given actually match the names of OutputSections in the file (probably warning if it doesn't match).

https://github.com/llvm/llvm-project/pull/95714


More information about the llvm-commits mailing list