[lld] [lld] Update error message for multiple linker script includes (PR #94861)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 8 08:56:15 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lld-elf

Author: None (quicvede)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/94861.diff


2 Files Affected:

- (modified) lld/ELF/ScriptParser.cpp (+1-1) 
- (modified) lld/test/ELF/linkerscript/include-cycle.s (+1-1) 


``````````diff
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index f90ce6fa74075..353266d7f5f1e 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -384,7 +384,7 @@ void ScriptParser::readInclude() {
   StringRef tok = unquote(next());
 
   if (!seen.insert(tok).second) {
-    setError("there is a cycle in linker script INCLUDEs");
+    setError("multiple includes of the same file are not allowed");
     return;
   }
 
diff --git a/lld/test/ELF/linkerscript/include-cycle.s b/lld/test/ELF/linkerscript/include-cycle.s
index e93ed904f05a3..8242296cf6d32 100644
--- a/lld/test/ELF/linkerscript/include-cycle.s
+++ b/lld/test/ELF/linkerscript/include-cycle.s
@@ -8,7 +8,7 @@
 # RUN: echo "INCLUDE \"%t1.script\"" > %t2.script
 # RUN: not ld.lld %t.o %t1.script 2>&1 | FileCheck %s
 
-# CHECK: there is a cycle in linker script INCLUDEs
+# CHECK: multiple includes of the same file are not allowed
 
 .globl _start
 _start:

``````````

</details>


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


More information about the llvm-commits mailing list