[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:55:31 PDT 2024


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

None

>From e2981a531518bc5d0adbe4aa32b8c0adfda80d74 Mon Sep 17 00:00:00 2001
From: vijaya ede <quic_vede at quicinc.com>
Date: Fri, 7 Jun 2024 17:19:45 +0530
Subject: [PATCH] [lld] Update error message for multiple linker script
 includes

---
 lld/ELF/ScriptParser.cpp                  | 2 +-
 lld/test/ELF/linkerscript/include-cycle.s | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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:



More information about the llvm-commits mailing list