Skip to content

Commit 360718f

Browse files
committed
[test] Improve symbol-location.s to check --defsym
1 parent d8495ed commit 360718f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lld/test/ELF/linkerscript/symbol-location.s

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
33
# RUN: echo 'foo = _start;' > %t.script
44
# RUN: not ld.lld -shared -T %t.script %t.o -o /dev/null 2>&1 | FileCheck %s
5+
# RUN: not ld.lld -shared --defsym 'foo = _start' %t.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK2
56

67
## Here we check that symbol 'foo' location is reported properly.
78

89
# CHECK: error: relocation R_X86_64_PC32 cannot be used against symbol 'foo'
910
# CHECK: >>> defined in {{.*}}.script:1
1011
# CHECK: >>> referenced by {{.*}}.o:(.text+0x1)
1112

13+
# CHECK2: error: relocation R_X86_64_PC32 cannot be used against symbol 'foo'
14+
# CHECK2: >>> defined in --defsym{{$}}
15+
# CHECK2: >>> referenced by {{.*}}.o:(.text+0x1)
16+
1217
.text
1318
.globl _start
1419
_start:

0 commit comments

Comments
 (0)