1// REQUIRES: x86
2// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3// RUN: not ld.lld -shared --vs-diagnostics %t.o -o /dev/null 2>&1 | FileCheck %s
4
5// CHECK: dyn.s(15): error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
6// CHECK-NEXT: >>> defined in {{.*}}.o
7// CHECK-NEXT: >>> referenced by dyn.s:15
8// CHECK-NEXT: >>>{{.*}}.o:(.text+0x{{.+}})
9
10// CHECK: /tmp{{/|\\}}dyn.s(20): error: can't create dynamic relocation {{.*}}
11// CHECK-NEXT: >>> defined in {{.*}}.o
12// CHECK-NEXT: >>> referenced by dyn.s:20 (/tmp{{/|\\}}dyn.s:20)
13// CHECK-NEXT: >>>{{.*}}.o:(.text+0x{{.+}})
14
15.file 1 "dyn.s"
16.loc 1 15
17
18foo:
19.quad foo
20
21.file 2 "/tmp" "dyn.s"
22.loc 2 20
23
24bar:
25.quad bar
26
27.section .debug_abbrev,"",@progbits
28  .byte  1                      # Abbreviation Code
29  .byte 17                      # DW_TAG_compile_unit
30  .byte  0                      # DW_CHILDREN_no
31  .byte 16                      # DW_AT_stmt_list
32  .byte 23                      # DW_FORM_sec_offset
33  .byte  0                      # EOM(1)
34  .byte  0                      # EOM(2)
35  .byte  0                      # EOM(3)
36
37.section .debug_info,"",@progbits
38  .long .Lend0 - .Lbegin0       # Length of Unit
39.Lbegin0:
40  .short 4                      # DWARF version number
41  .long  .debug_abbrev          # Offset Into Abbrev. Section
42  .byte  8                      # Address Size (in bytes)
43  .byte  1                      # Abbrev [1] 0xb:0x1f DW_TAG_compile_unit
44  .long  .debug_line            # DW_AT_stmt_list
45.Lend0:
46  .section .debug_line,"",@progbits
47