[lld] [ELF] Support NOCROSSREFS and NOCROSSERFS_TO (PR #98773)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 16 10:25:56 PDT 2024


================
@@ -299,6 +304,15 @@ void ScriptParser::readDefsym(StringRef name) {
   script->sectionCommands.push_back(cmd);
 }
 
+void ScriptParser::readNoCrossRefs(bool to) {
+  expect("(");
+  NoCrossRefCommand cmd{{}, to};
+  while (!errorCount() && !consume(")"))
+    cmd.outputSections.push_back(unquote(next()));
+  if (cmd.outputSections.size() >= 2)
+    script->noCrossRefs.push_back(std::move(cmd));
+}
----------------
MaskRay wrote:

Added a warning. 

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


More information about the llvm-commits mailing list