[lld] b30b1f1 - [ELF] Add single quotes around out of range errors

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 3 12:48:21 PST 2023


Author: Fangrui Song
Date: 2023-03-03T12:48:16-08:00
New Revision: b30b1f173c911d9b04bbe70ad9b1e3c6c3cd6246

URL: https://github.com/llvm/llvm-project/commit/b30b1f173c911d9b04bbe70ad9b1e3c6c3cd6246
DIFF: https://github.com/llvm/llvm-project/commit/b30b1f173c911d9b04bbe70ad9b1e3c6c3cd6246.diff

LOG: [ELF] Add single quotes around out of range errors

to match the convention we use for other diagnostics.

Added: 
    

Modified: 
    lld/ELF/Relocations.cpp
    lld/test/ELF/aarch64-abs16.s
    lld/test/ELF/aarch64-abs32.s
    lld/test/ELF/aarch64-movw-error.s
    lld/test/ELF/aarch64-prel16.s
    lld/test/ELF/aarch64-prel32.s
    lld/test/ELF/aarch64-reloc-plt32.s
    lld/test/ELF/arm-adr-err-long.s
    lld/test/ELF/arm-adr-err.s
    lld/test/ELF/i386-reloc-16.s
    lld/test/ELF/i386-reloc-8.s
    lld/test/ELF/i386-reloc-range.s
    lld/test/ELF/ppc64-pcrel-call-to-toc-error.s
    lld/test/ELF/ppc64-pcrel-long-branch-error.s
    lld/test/ELF/ppc64-reloc-addr-err.s
    lld/test/ELF/riscv-branch.s
    lld/test/ELF/riscv-call.s
    lld/test/ELF/riscv-hi20-lo12.s
    lld/test/ELF/riscv-jal.s
    lld/test/ELF/riscv-pcrel-hilo.s
    lld/test/ELF/x86-64-gotpc-err.s
    lld/test/ELF/x86-64-reloc-error.s
    lld/test/ELF/x86-64-reloc-error2.s
    lld/test/ELF/x86-64-reloc-range-debug-loc.s

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index fc0c022f8096..6f2280b678b4 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -101,7 +101,7 @@ void elf::reportRangeError(uint8_t *loc, const Relocation &rel, const Twine &v,
   std::string hint;
   if (rel.sym) {
     if (!rel.sym->isSection())
-      hint = "; references " + lld::toString(*rel.sym);
+      hint = "; references '" + lld::toString(*rel.sym) + '\'';
     else if (auto *d = dyn_cast<Defined>(rel.sym))
       hint = ("; references section '" + d->section->name + "'").str();
   }
@@ -124,7 +124,8 @@ void elf::reportRangeError(uint8_t *loc, int64_t v, int n, const Symbol &sym,
   ErrorPlace errPlace = getErrorPlace(loc);
   std::string hint;
   if (!sym.getName().empty())
-    hint = "; references " + lld::toString(sym) + getDefinedLocation(sym);
+    hint =
+        "; references '" + lld::toString(sym) + '\'' + getDefinedLocation(sym);
   errorOrWarn(errPlace.loc + msg + " is out of range: " + Twine(v) +
               " is not in [" + Twine(llvm::minIntN(n)) + ", " +
               Twine(llvm::maxIntN(n)) + "]" + hint);

diff  --git a/lld/test/ELF/aarch64-abs16.s b/lld/test/ELF/aarch64-abs16.s
index 530492141262..0ced866cd1cf 100644
--- a/lld/test/ELF/aarch64-abs16.s
+++ b/lld/test/ELF/aarch64-abs16.s
@@ -26,7 +26,7 @@ _start:
 // BE-NEXT: 220158 ffff8000
 
 // RUN: not ld.lld %t.o %t255.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=OVERFLOW1
-// OVERFLOW1: relocation R_AARCH64_ABS16 out of range: -32769 is not in [-32768, 65535]; references foo
+// OVERFLOW1: relocation R_AARCH64_ABS16 out of range: -32769 is not in [-32768, 65535]; references 'foo'
 
 // RUN: not ld.lld %t.o %t257.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=OVERFLOW2
-// OVERFLOW2: relocation R_AARCH64_ABS16 out of range: 65536 is not in [-32768, 65535]; references foo
+// OVERFLOW2: relocation R_AARCH64_ABS16 out of range: 65536 is not in [-32768, 65535]; references 'foo'

diff  --git a/lld/test/ELF/aarch64-abs32.s b/lld/test/ELF/aarch64-abs32.s
index 8bbacd9d6ca8..66547a55b8d2 100644
--- a/lld/test/ELF/aarch64-abs32.s
+++ b/lld/test/ELF/aarch64-abs32.s
@@ -26,7 +26,7 @@ _start:
 // BE-NEXT: 220158 ffffffff 80000000
 
 // RUN: not ld.lld %t.o %t255.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=OVERFLOW1
-// OVERFLOW1: relocation R_AARCH64_ABS32 out of range: -2147483649 is not in [-2147483648, 4294967295]; references foo
+// OVERFLOW1: relocation R_AARCH64_ABS32 out of range: -2147483649 is not in [-2147483648, 4294967295]; references 'foo'
 
 // RUN: not ld.lld %t.o %t257.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=OVERFLOW2
-// OVERFLOW2: relocation R_AARCH64_ABS32 out of range: 4294967296 is not in [-2147483648, 4294967295]; references foo
+// OVERFLOW2: relocation R_AARCH64_ABS32 out of range: 4294967296 is not in [-2147483648, 4294967295]; references 'foo'

diff  --git a/lld/test/ELF/aarch64-movw-error.s b/lld/test/ELF/aarch64-movw-error.s
index cfca054e6e66..0a008adbd9e8 100644
--- a/lld/test/ELF/aarch64-movw-error.s
+++ b/lld/test/ELF/aarch64-movw-error.s
@@ -36,11 +36,11 @@ movn x0, #:prel_g1:.-0x100010000
 movn x0, #:prel_g2:.-0x1000100000000
 
 movz x0, #:tprel_g0: v1
-# CHECK: relocation R_AARCH64_TLSLE_MOVW_TPREL_G0 out of range: 65552 is not in [-65536, 65535]; references v1
+# CHECK: relocation R_AARCH64_TLSLE_MOVW_TPREL_G0 out of range: 65552 is not in [-65536, 65535]; references 'v1'
 movz x0, #:tprel_g1: v2
-# CHECK: relocation R_AARCH64_TLSLE_MOVW_TPREL_G1 out of range: 4295032848 is not in [-4294967296, 4294967295]; references v2
+# CHECK: relocation R_AARCH64_TLSLE_MOVW_TPREL_G1 out of range: 4295032848 is not in [-4294967296, 4294967295]; references 'v2'
 movz x0, #:tprel_g2: v3
-# CHECK: relocation R_AARCH64_TLSLE_MOVW_TPREL_G2 out of range: 281479271743496 is not in [-281474976710656, 281474976710655]; references v3
+# CHECK: relocation R_AARCH64_TLSLE_MOVW_TPREL_G2 out of range: 281479271743496 is not in [-281474976710656, 281474976710655]; references 'v3'
 
 .section .tbss,"awT", at nobits
 .balign 16

diff  --git a/lld/test/ELF/aarch64-prel16.s b/lld/test/ELF/aarch64-prel16.s
index 757928359072..04d9901a5c2f 100644
--- a/lld/test/ELF/aarch64-prel16.s
+++ b/lld/test/ELF/aarch64-prel16.s
@@ -30,7 +30,7 @@ _start:
 // BE-NEXT: 202158 ffff8000
 
 // RUN: not ld.lld -z max-page-size=4096 %t.o %t255.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=OVERFLOW1
-// OVERFLOW1: relocation R_AARCH64_PREL16 out of range: -32769 is not in [-32768, 65535]; references foo
+// OVERFLOW1: relocation R_AARCH64_PREL16 out of range: -32769 is not in [-32768, 65535]; references 'foo'
 
 // RUN: not ld.lld -z max-page-size=4096 %t.o %t257.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=OVERFLOW2
-// OVERFLOW2: relocation R_AARCH64_PREL16 out of range: 65536 is not in [-32768, 65535]; references foo
+// OVERFLOW2: relocation R_AARCH64_PREL16 out of range: 65536 is not in [-32768, 65535]; references 'foo'

diff  --git a/lld/test/ELF/aarch64-prel32.s b/lld/test/ELF/aarch64-prel32.s
index ce9f0596eb27..95a91cdb41cb 100644
--- a/lld/test/ELF/aarch64-prel32.s
+++ b/lld/test/ELF/aarch64-prel32.s
@@ -30,7 +30,7 @@ _start:
 // BE-NEXT: 202158 ffffffff 80000000
 
 // RUN: not ld.lld -z max-page-size=4096 %t.o %t255.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=OVERFLOW1
-// OVERFLOW1: relocation R_AARCH64_PREL32 out of range: -2147483649 is not in [-2147483648, 4294967295]; references foo
+// OVERFLOW1: relocation R_AARCH64_PREL32 out of range: -2147483649 is not in [-2147483648, 4294967295]; references 'foo'
 
 // RUN: not ld.lld -z max-page-size=4096 %t.o %t257.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=OVERFLOW2
-// OVERFLOW2: relocation R_AARCH64_PREL32 out of range: 4294967296 is not in [-2147483648, 4294967295]; references foo
+// OVERFLOW2: relocation R_AARCH64_PREL32 out of range: 4294967296 is not in [-2147483648, 4294967295]; references 'foo'

diff  --git a/lld/test/ELF/aarch64-reloc-plt32.s b/lld/test/ELF/aarch64-reloc-plt32.s
index 2e56dfd1986f..8a3b989a909b 100644
--- a/lld/test/ELF/aarch64-reloc-plt32.s
+++ b/lld/test/ELF/aarch64-reloc-plt32.s
@@ -24,10 +24,10 @@
 // BE-NEXT: 202158 7fffffff 80000000 ffdfdfa0
 
 // RUN: not ld.lld -z max-page-size=4096 %t.o %t255.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=OVERFLOW1
-// OVERFLOW1: relocation R_AARCH64_PLT32 out of range: -2147483649 is not in [-2147483648, 2147483647]; references foo
+// OVERFLOW1: relocation R_AARCH64_PLT32 out of range: -2147483649 is not in [-2147483648, 2147483647]; references 'foo'
 
 // RUN: not ld.lld -z max-page-size=4096 %t.o %t257.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=OVERFLOW2
-// OVERFLOW2: relocation R_AARCH64_PLT32 out of range: 2147483648 is not in [-2147483648, 2147483647]; references foo
+// OVERFLOW2: relocation R_AARCH64_PLT32 out of range: 2147483648 is not in [-2147483648, 2147483647]; references 'foo'
 
   .globl _start
   _start:

diff  --git a/lld/test/ELF/arm-adr-err-long.s b/lld/test/ELF/arm-adr-err-long.s
index 0fd6beaba512..6b6941e0d036 100644
--- a/lld/test/ELF/arm-adr-err-long.s
+++ b/lld/test/ELF/arm-adr-err-long.s
@@ -49,7 +49,7 @@ _start:
  .inst 0xe1c000d0 // ldrd r0, r1, [r0, #0]
  .reloc 32, R_ARM_ALU_PC_G0_NC, dat2
  .reloc 36, R_ARM_ALU_PC_G1_NC, dat2
-// CHECK: {{.*}}.s.tmp.o:(.text.1+0x28): relocation R_ARM_LDRS_PC_G2 out of range: 4056 is not in [0, 255]; references dat2
+// CHECK: {{.*}}.s.tmp.o:(.text.1+0x28): relocation R_ARM_LDRS_PC_G2 out of range: 4056 is not in [0, 255]; references 'dat2'
  .reloc 40, R_ARM_LDRS_PC_G2, dat2
 
  .section .text.2, "ax", %progbits

diff  --git a/lld/test/ELF/arm-adr-err.s b/lld/test/ELF/arm-adr-err.s
index be1305e7b010..ab7cb6131147 100644
--- a/lld/test/ELF/arm-adr-err.s
+++ b/lld/test/ELF/arm-adr-err.s
@@ -25,7 +25,7 @@ _start:
 
  .balign 512
 /// ldrd r0, r1, _start
-// CHECK: {{.*}}.s.tmp.o:(.os1+0x200): relocation R_ARM_LDRS_PC_G0 out of range: 512 is not in [0, 255]; references _start
+// CHECK: {{.*}}.s.tmp.o:(.os1+0x200): relocation R_ARM_LDRS_PC_G0 out of range: 512 is not in [0, 255]; references '_start'
  .reloc ., R_ARM_LDRS_PC_G0, _start
  .inst 0xe14f00d0
 

diff  --git a/lld/test/ELF/i386-reloc-16.s b/lld/test/ELF/i386-reloc-16.s
index 9b894e8beb78..b813547bab37 100644
--- a/lld/test/ELF/i386-reloc-16.s
+++ b/lld/test/ELF/i386-reloc-16.s
@@ -7,11 +7,11 @@
 
 # RUN: not ld.lld %t.o --defsym=a=-1 --defsym=b=0 -o /dev/null 2>&1 | \
 # RUN:   FileCheck --check-prefix=OVERFLOW1 %s
-# OVERFLOW1: relocation R_386_16 out of range: -32769 is not in [-32768, 65535]; references a
+# OVERFLOW1: relocation R_386_16 out of range: -32769 is not in [-32768, 65535]; references 'a'
 
 # RUN: not ld.lld %t.o --defsym=a=0 --defsym=b=32769 -o /dev/null 2>&1 | \
 # RUN:   FileCheck --check-prefix=OVERFLOW2 %s
-# OVERFLOW2: relocation R_386_16 out of range: 65536 is not in [-32768, 65535]; references b
+# OVERFLOW2: relocation R_386_16 out of range: 65536 is not in [-32768, 65535]; references 'b'
 
 .code16
 .global _start

diff  --git a/lld/test/ELF/i386-reloc-8.s b/lld/test/ELF/i386-reloc-8.s
index ddf1c1de392d..4cb5c7a6ce6e 100644
--- a/lld/test/ELF/i386-reloc-8.s
+++ b/lld/test/ELF/i386-reloc-8.s
@@ -7,11 +7,11 @@
 
 # RUN: not ld.lld %t.o --defsym=a=-1 --defsym=b=0 -o /dev/null 2>&1 | \
 # RUN:   FileCheck --check-prefix=OVERFLOW1 %s
-# OVERFLOW1: relocation R_386_8 out of range: -129 is not in [-128, 255]; references a
+# OVERFLOW1: relocation R_386_8 out of range: -129 is not in [-128, 255]; references 'a'
 
 # RUN: not ld.lld %t.o --defsym=a=0 --defsym=b=129 -o /dev/null 2>&1 | \
 # RUN:   FileCheck --check-prefix=OVERFLOW2 %s
-# OVERFLOW2: relocation R_386_8 out of range: 256 is not in [-128, 255]; references b
+# OVERFLOW2: relocation R_386_8 out of range: 256 is not in [-128, 255]; references 'b'
 
 .code16
 .globl _start

diff  --git a/lld/test/ELF/i386-reloc-range.s b/lld/test/ELF/i386-reloc-range.s
index 0c15e6a9e055..1ca6dbabecba 100644
--- a/lld/test/ELF/i386-reloc-range.s
+++ b/lld/test/ELF/i386-reloc-range.s
@@ -17,7 +17,7 @@
 
 // RUN: not ld.lld -Ttext 0x200 %t.o %t2.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s
 
-// ERR: {{.*}}:(.text+0x1): relocation R_386_PC16 out of range: 65536 is not in [-65536, 65535]; references foo
+// ERR: {{.*}}:(.text+0x1): relocation R_386_PC16 out of range: 65536 is not in [-65536, 65535]; references 'foo'
 
         .global _start
 _start:

diff  --git a/lld/test/ELF/ppc64-pcrel-call-to-toc-error.s b/lld/test/ELF/ppc64-pcrel-call-to-toc-error.s
index 7fe4b2ed127f..b3bce5d62bc7 100644
--- a/lld/test/ELF/ppc64-pcrel-call-to-toc-error.s
+++ b/lld/test/ELF/ppc64-pcrel-call-to-toc-error.s
@@ -10,7 +10,7 @@
 # RUN: ld.lld --script %t/lds %t.o -o %t1 --noinhibit-exec
 # RUN: rm %t.o %t1
 
-# CHECK: error: R12 setup stub offset is out of range: 8589934592 is not in [-8589934592, 8589934591]; references callee
+# CHECK: error: R12 setup stub offset is out of range: 8589934592 is not in [-8589934592, 8589934591]; references 'callee'
 # CHECK-NEXT: >>> defined in {{.*}}.o
 
 //--- asm

diff  --git a/lld/test/ELF/ppc64-pcrel-long-branch-error.s b/lld/test/ELF/ppc64-pcrel-long-branch-error.s
index a572e69b95d0..618acdf36b04 100644
--- a/lld/test/ELF/ppc64-pcrel-long-branch-error.s
+++ b/lld/test/ELF/ppc64-pcrel-long-branch-error.s
@@ -19,7 +19,7 @@
 # RUN: rm %t.o %t1
 
 ## Note: GNU ld uses sldi 11, 11, 34 and add 12, 11, 12 to support offsets beyond +-2**33.
-# CHECK: error: R12 setup stub offset is out of range: 8589934592 is not in [-8589934592, 8589934591]; references high
+# CHECK: error: R12 setup stub offset is out of range: 8589934592 is not in [-8589934592, 8589934591]; references 'high'
 # CHECK-NEXT: >>> defined in {{.*}}.o
 
 //--- asm

diff  --git a/lld/test/ELF/ppc64-reloc-addr-err.s b/lld/test/ELF/ppc64-reloc-addr-err.s
index ef423a1c2e2b..cdd0760d83c4 100644
--- a/lld/test/ELF/ppc64-reloc-addr-err.s
+++ b/lld/test/ELF/ppc64-reloc-addr-err.s
@@ -9,12 +9,12 @@
 # CHECK: 0x{{[0-9a-f]+}} ffff0080 ffffffff 00000080
 
 # RUN: not ld.lld %t.o %t255.o -o /dev/null 2>&1 | FileCheck --check-prefix=OVERFLOW1 %s
-# OVERFLOW1: relocation R_PPC64_ADDR16 out of range: -32769 is not in [-32768, 65535]; references foo
-# OVERFLOW1: relocation R_PPC64_ADDR32 out of range: -2147483649 is not in [-2147483648, 4294967295]; references foo
+# OVERFLOW1: relocation R_PPC64_ADDR16 out of range: -32769 is not in [-32768, 65535]; references 'foo'
+# OVERFLOW1: relocation R_PPC64_ADDR32 out of range: -2147483649 is not in [-2147483648, 4294967295]; references 'foo'
 
 # RUN: not ld.lld %t.o %t257.o -o /dev/null 2>&1 | FileCheck --check-prefix=OVERFLOW2 %s
-# OVERFLOW2: relocation R_PPC64_ADDR16 out of range: 65536 is not in [-32768, 65535]; references foo
-# OVERFLOW2: relocation R_PPC64_ADDR32 out of range: 4294967296 is not in [-2147483648, 4294967295]; references foo
+# OVERFLOW2: relocation R_PPC64_ADDR16 out of range: 65536 is not in [-32768, 65535]; references 'foo'
+# OVERFLOW2: relocation R_PPC64_ADDR32 out of range: 4294967296 is not in [-2147483648, 4294967295]; references 'foo'
 
 .globl _start
 _start:

diff  --git a/lld/test/ELF/riscv-branch.s b/lld/test/ELF/riscv-branch.s
index 78d1325b1fc3..b2b85fccc82d 100644
--- a/lld/test/ELF/riscv-branch.s
+++ b/lld/test/ELF/riscv-branch.s
@@ -23,8 +23,8 @@
 
 # RUN: not ld.lld %t.rv32.o --defsym foo=_start+0x1000 --defsym bar=_start+4-0x1002 -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR-RANGE %s
 # RUN: not ld.lld %t.rv64.o --defsym foo=_start+0x1000 --defsym bar=_start+4-0x1002 -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR-RANGE %s
-# ERROR-RANGE: relocation R_RISCV_BRANCH out of range: 4096 is not in [-4096, 4095]; references foo
-# ERROR-RANGE: relocation R_RISCV_BRANCH out of range: -4098 is not in [-4096, 4095]; references bar
+# ERROR-RANGE: relocation R_RISCV_BRANCH out of range: 4096 is not in [-4096, 4095]; references 'foo'
+# ERROR-RANGE: relocation R_RISCV_BRANCH out of range: -4098 is not in [-4096, 4095]; references 'bar'
 
 # RUN: not ld.lld %t.rv32.o --defsym foo=_start+1 --defsym bar=_start-1 -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR-ALIGN %s
 # RUN: not ld.lld %t.rv64.o --defsym foo=_start+1 --defsym bar=_start-1 -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR-ALIGN %s

diff  --git a/lld/test/ELF/riscv-call.s b/lld/test/ELF/riscv-call.s
index a6e9fde39450..c4c89c35b7fe 100644
--- a/lld/test/ELF/riscv-call.s
+++ b/lld/test/ELF/riscv-call.s
@@ -24,8 +24,8 @@
 # RUN: ld.lld %t.rv32.o --defsym foo=_start+0x7ffff800 --defsym bar=_start+8-0x80000801 -o %t
 # RUN: not ld.lld %t.rv64.o --defsym foo=_start+0x7ffff800 --defsym bar=_start+8-0x80000801 -o /dev/null 2>&1 | \
 # RUN:   FileCheck --check-prefix=ERROR %s
-# ERROR: relocation R_RISCV_CALL_PLT out of range: 524288 is not in [-524288, 524287]; references foo
-# ERROR: relocation R_RISCV_CALL_PLT out of range: -524289 is not in [-524288, 524287]; references bar
+# ERROR: relocation R_RISCV_CALL_PLT out of range: 524288 is not in [-524288, 524287]; references 'foo'
+# ERROR: relocation R_RISCV_CALL_PLT out of range: -524289 is not in [-524288, 524287]; references 'bar'
 
 .global _start
 _start:

diff  --git a/lld/test/ELF/riscv-hi20-lo12.s b/lld/test/ELF/riscv-hi20-lo12.s
index 1c57f31b58a4..4a0c619ae0d2 100644
--- a/lld/test/ELF/riscv-hi20-lo12.s
+++ b/lld/test/ELF/riscv-hi20-lo12.s
@@ -26,8 +26,8 @@
 # LIMITS-NEXT: 23 a0 b5 80     sw      a1, -2048(a1)
 
 # RUN: not ld.lld %t.rv64.o --defsym foo=0x7ffff800 --defsym bar=0xffffffff7ffff7ff -o /dev/null 2>&1 | FileCheck --check-prefix ERROR %s
-# ERROR: relocation R_RISCV_HI20 out of range: 524288 is not in [-524288, 524287]; references foo
-# ERROR: relocation R_RISCV_HI20 out of range: -524289 is not in [-524288, 524287]; references bar
+# ERROR: relocation R_RISCV_HI20 out of range: 524288 is not in [-524288, 524287]; references 'foo'
+# ERROR: relocation R_RISCV_HI20 out of range: -524289 is not in [-524288, 524287]; references 'bar'
 
 .global _start
 

diff  --git a/lld/test/ELF/riscv-jal.s b/lld/test/ELF/riscv-jal.s
index 466772ee983f..cd3b842aad60 100644
--- a/lld/test/ELF/riscv-jal.s
+++ b/lld/test/ELF/riscv-jal.s
@@ -23,8 +23,8 @@
 
 # RUN: not ld.lld %t.rv32.o --defsym foo=_start+0x100000 --defsym bar=_start+4-0x100002 -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR-RANGE %s
 # RUN: not ld.lld %t.rv64.o --defsym foo=_start+0x100000 --defsym bar=_start+4-0x100002 -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR-RANGE %s
-# ERROR-RANGE: relocation R_RISCV_JAL out of range: 1048576 is not in [-1048576, 1048575]; references foo
-# ERROR-RANGE: relocation R_RISCV_JAL out of range: -1048578 is not in [-1048576, 1048575]; references bar
+# ERROR-RANGE: relocation R_RISCV_JAL out of range: 1048576 is not in [-1048576, 1048575]; references 'foo'
+# ERROR-RANGE: relocation R_RISCV_JAL out of range: -1048578 is not in [-1048576, 1048575]; references 'bar'
 
 # RUN: not ld.lld %t.rv32.o --defsym foo=_start+1 --defsym bar=_start+4+3 -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR-ALIGN %s
 # RUN: not ld.lld %t.rv64.o --defsym foo=_start+1 --defsym bar=_start+4+3 -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR-ALIGN %s

diff  --git a/lld/test/ELF/riscv-pcrel-hilo.s b/lld/test/ELF/riscv-pcrel-hilo.s
index a991d80ef103..a553e29d0485 100644
--- a/lld/test/ELF/riscv-pcrel-hilo.s
+++ b/lld/test/ELF/riscv-pcrel-hilo.s
@@ -31,8 +31,8 @@
 
 # RUN: ld.lld %t.rv32.o --defsym foo=_start+0x7ffff800 --defsym bar=_start+12-0x80000801 -o %t
 # RUN: not ld.lld %t.rv64.o --defsym foo=_start+0x7ffff800 --defsym bar=_start+12-0x80000801 -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR %s
-# ERROR: relocation R_RISCV_PCREL_HI20 out of range: 524288 is not in [-524288, 524287]; references foo
-# ERROR: relocation R_RISCV_PCREL_HI20 out of range: -524289 is not in [-524288, 524287]; references bar
+# ERROR: relocation R_RISCV_PCREL_HI20 out of range: 524288 is not in [-524288, 524287]; references 'foo'
+# ERROR: relocation R_RISCV_PCREL_HI20 out of range: -524289 is not in [-524288, 524287]; references 'bar'
 
 .global _start
 _start:

diff  --git a/lld/test/ELF/x86-64-gotpc-err.s b/lld/test/ELF/x86-64-gotpc-err.s
index 1dbfc4584dd5..6fc7cbe0125c 100644
--- a/lld/test/ELF/x86-64-gotpc-err.s
+++ b/lld/test/ELF/x86-64-gotpc-err.s
@@ -7,8 +7,8 @@
 ## `>>> defined in` for linker synthesized __stop_* symbols (there is no
 ## associated file or linker script line number).
 
-# CHECK:      error: {{.*}}:(.text+0x2): relocation R_X86_64_GOTPCRELX out of range: 2147483655 is not in [-2147483648, 2147483647]; references __stop_data
-# CHECK-NEXT: error: {{.*}}:(.text+0x9): relocation R_X86_64_REX_GOTPCRELX out of range: 2147483648 is not in [-2147483648, 2147483647]; references __stop_data
+# CHECK:      error: {{.*}}:(.text+0x2): relocation R_X86_64_GOTPCRELX out of range: 2147483655 is not in [-2147483648, 2147483647]; references '__stop_data'
+# CHECK-NEXT: error: {{.*}}:(.text+0x9): relocation R_X86_64_REX_GOTPCRELX out of range: 2147483648 is not in [-2147483648, 2147483647]; references '__stop_data'
 # CHECK-NOT: error:
 
 #--- a.s

diff  --git a/lld/test/ELF/x86-64-reloc-error.s b/lld/test/ELF/x86-64-reloc-error.s
index 9fe24818f949..559f8ece0ff8 100644
--- a/lld/test/ELF/x86-64-reloc-error.s
+++ b/lld/test/ELF/x86-64-reloc-error.s
@@ -6,7 +6,7 @@
   movl $big, %edx
   movq $foo - 0x1000000000000, %rdx
 
-# CHECK: {{.*}}:(.text+0x1): relocation R_X86_64_32 out of range: 68719476736 is not in [0, 4294967295]; references big
+# CHECK: {{.*}}:(.text+0x1): relocation R_X86_64_32 out of range: 68719476736 is not in [0, 4294967295]; references 'big'
 # CHECK-NEXT: >>> defined in {{.*}}1.o
-# CHECK: {{.*}}:(.text+0x8): relocation R_X86_64_32S out of range: -281474976710656 is not in [-2147483648, 2147483647]; references foo
+# CHECK: {{.*}}:(.text+0x8): relocation R_X86_64_32S out of range: -281474976710656 is not in [-2147483648, 2147483647]; references 'foo'
 # CHECK-NEXT: >>> defined in {{.*}}1.o

diff  --git a/lld/test/ELF/x86-64-reloc-error2.s b/lld/test/ELF/x86-64-reloc-error2.s
index d1803c9e6cff..c2e1fd4d7406 100644
--- a/lld/test/ELF/x86-64-reloc-error2.s
+++ b/lld/test/ELF/x86-64-reloc-error2.s
@@ -4,7 +4,7 @@
 
 ## Check we are able to find a function symbol that encloses
 ## a given location when reporting error messages.
-# CHECK: {{.*}}.o:(function func: .text.func+0x3): relocation R_X86_64_32S out of range: -281474974609120 is not in [-2147483648, 2147483647]; references func
+# CHECK: {{.*}}.o:(function func: .text.func+0x3): relocation R_X86_64_32S out of range: -281474974609120 is not in [-2147483648, 2147483647]; references 'func'
 # CHECK-NEXT: >>> defined in {{.*}}.o
 # CHECK-EMPTY:
 

diff  --git a/lld/test/ELF/x86-64-reloc-range-debug-loc.s b/lld/test/ELF/x86-64-reloc-range-debug-loc.s
index 7635870061bb..0059de975f3c 100644
--- a/lld/test/ELF/x86-64-reloc-range-debug-loc.s
+++ b/lld/test/ELF/x86-64-reloc-range-debug-loc.s
@@ -8,11 +8,11 @@
 
 ## Check we are able to report file and location from debug information
 ## when reporting such kind of errors.
-# CHECK:      error: {{.*}}.o:(.text+0x1): relocation R_X86_64_32 out of range: 68719476736 is not in [0, 4294967295]; references big
+# CHECK:      error: {{.*}}.o:(.text+0x1): relocation R_X86_64_32 out of range: 68719476736 is not in [0, 4294967295]; references 'big'
 # CHECK-NEXT: >>> referenced by test.s:3
 # CHECK-NEXT: >>> defined in {{.*}}abs
 
-# CHECK2:      error: {{.*}}.a({{.*}}.o):(.text+0x1): relocation R_X86_64_32 out of range: 68719476736 is not in [0, 4294967295]; references big
+# CHECK2:      error: {{.*}}.a({{.*}}.o):(.text+0x1): relocation R_X86_64_32 out of range: 68719476736 is not in [0, 4294967295]; references 'big'
 # CHECK2-NEXT: >>> referenced by test.s:3
 # CHECK2-NEXT: >>> defined in {{.*}}abs
 


        


More information about the llvm-commits mailing list