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

Pavel Skripkin via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 18 05:31:49 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();
----------------
pskrgag wrote:

GNU ld silently ignores unknown section names. Maybe this is because some sections may appear only depending on some build options and warning may abort build process with `--fatal-warnings` specified. 

Anyway, i don't have strong opinion here, I just think it might be a good idea to be fully compatible with GNU ld.

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


More information about the llvm-commits mailing list