1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3# RUN: echo 'foo = _start;' > %t.script
4# RUN: not ld.lld -shared -T %t.script %t.o -o /dev/null 2>&1 | FileCheck %s
5
6## Here we check that symbol 'foo' location is reported properly.
7
8# CHECK: error: relocation R_X86_64_PC32 cannot be used against symbol foo
9# CHECK: >>> defined in {{.*}}.script:1
10# CHECK: >>> referenced by {{.*}}.o:(.text+0x1)
11
12.text
13.globl _start
14_start:
15  .byte 0xe8
16  .long foo - .
17