2 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/relocation-size-shared.s -o %tso.o
4 // RUN: ld.lld -shared %tso.o -o %tso
5 // RUN: ld.lld %t.o %tso -o %t1
6 // RUN: llvm-readobj -r %t1 | FileCheck --check-prefix=RELOCSHARED %s
7 // RUN: llvm-objdump -d %t1 | FileCheck --check-prefix=DISASM %s
9 // RELOCSHARED: Relocations [
10 // RELOCSHARED-NEXT: Section ({{.*}}) .rela.dyn {
11 // RELOCSHARED-NEXT: 0x201018 R_X86_64_SIZE64 fooshared 0xFFFFFFFFFFFFFFFF
12 // RELOCSHARED-NEXT: 0x201020 R_X86_64_SIZE64 fooshared 0x0
13 // RELOCSHARED-NEXT: 0x201028 R_X86_64_SIZE64 fooshared 0x1
14 // RELOCSHARED-NEXT: 0x201048 R_X86_64_SIZE32 fooshared 0xFFFFFFFFFFFFFFFF
15 // RELOCSHARED-NEXT: 0x20104F R_X86_64_SIZE32 fooshared 0x0
16 // RELOCSHARED-NEXT: 0x201056 R_X86_64_SIZE32 fooshared 0x1
17 // RELOCSHARED-NEXT: }
20 // DISASM: Disassembly of section test
22 // DISASM-NEXT: 201000: 19 00
23 // DISASM-NEXT: 201002: 00 00
24 // DISASM-NEXT: 201004: 00 00
25 // DISASM-NEXT: 201006: 00 00
26 // DISASM-NEXT: 201008: 1a 00
27 // DISASM-NEXT: 20100a: 00 00
28 // DISASM-NEXT: 20100c: 00 00
29 // DISASM-NEXT: 20100e: 00 00
30 // DISASM-NEXT: 201010: 1b 00
31 // DISASM-NEXT: 201012: 00 00
32 // DISASM-NEXT: 201014: 00 00
33 // DISASM-NEXT: 201016: 00 00
34 // DISASM-NEXT: 201018: 00 00
35 // DISASM-NEXT: 20101a: 00 00
36 // DISASM-NEXT: 20101c: 00 00
37 // DISASM-NEXT: 20101e: 00 00
38 // DISASM-NEXT: 201020: 00 00
39 // DISASM-NEXT: 201022: 00 00
40 // DISASM-NEXT: 201024: 00 00
41 // DISASM-NEXT: 201026: 00 00
42 // DISASM-NEXT: 201028: 00 00
43 // DISASM-NEXT: 20102a: 00 00
44 // DISASM-NEXT: 20102c: 00 00
45 // DISASM-NEXT: 20102e: 00 00
47 // DISASM-NEXT: 201030: 8b 04 25 19 00 00 00 movl 25, %eax
48 // DISASM-NEXT: 201037: 8b 04 25 1a 00 00 00 movl 26, %eax
49 // DISASM-NEXT: 20103e: 8b 04 25 1b 00 00 00 movl 27, %eax
50 // DISASM-NEXT: 201045: 8b 04 25 00 00 00 00 movl 0, %eax
51 // DISASM-NEXT: 20104c: 8b 04 25 00 00 00 00 movl 0, %eax
52 // DISASM-NEXT: 201053: 8b 04 25 00 00 00 00 movl 0, %eax
67 .quad fooshared@SIZE-1
69 .quad fooshared@SIZE+1
77 movl fooshared@SIZE-1,%eax
78 movl fooshared@SIZE,%eax
79 movl fooshared@SIZE+1,%eax