2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3 # RUN: ld.lld %t.o -o %t
4 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=NORELOC %s
5 # RUN: llvm-readelf -x .data -x nonalloc %t | FileCheck --check-prefix=DATA %s
6 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck --check-prefix=DISASM %s
8 # RUN: ld.lld -shared %t.o -o %t.so
9 # RUN: llvm-readobj -r %t.so | FileCheck --check-prefix=RELOC2 %s
10 # RUN: llvm-readelf -x .data %t.so | FileCheck --check-prefix=DATA2 %s
11 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck --check-prefix=DISASM2 %s
13 # NORELOC: Relocations [
16 # DATA: section '.data':
17 # DATA-NEXT: 0x002031ac 00000000 00000000 00000000 00000000
18 # DATA-NEXT: 0x002031bc 00000000 00000000 00001900 00000000
19 # DATA-NEXT: 0x002031cc 00001b00 00000000 00001900 00000000
20 # DATA-NEXT: 0x002031dc 00001b00 00000000 0000
22 # DATA: section 'nonalloc':
23 # DATA-NEXT: 0x00000000 1a000000 00000000
26 # DISASM-NEXT: movl 25, %eax
27 # DISASM-NEXT: movl 27, %eax
28 # DISASM-NEXT: movl 25, %eax
29 # DISASM-NEXT: movl 27, %eax
31 # RELOC2: Relocations [
32 # RELOC2-NEXT: Section ({{.*}}) .rela.dyn {
33 # RELOC2-NEXT: 0x2333 R_X86_64_SIZE32 foo 0xFFFFFFFFFFFFFFFF
34 # RELOC2-NEXT: 0x233A R_X86_64_SIZE32 foo 0x1
35 # RELOC2-NEXT: 0x440A R_X86_64_SIZE64 foo 0xFFFFFFFFFFFFFFFF
36 # RELOC2-NEXT: 0x4412 R_X86_64_SIZE64 foo 0x1
40 # DATA2: section '.data':
41 # DATA2-NEXT: 00000000 00000000 00000000 00000000
42 # DATA2-NEXT: 00000000 00000000 00000000 00000000
43 # DATA2-NEXT: 00000000 00000000 00001900 00000000
44 # DATA2-NEXT: 00001b00 00000000 0000
47 # DISASM2-NEXT: movl 0, %eax
48 # DISASM2-NEXT: movl 0, %eax
49 # DISASM2-NEXT: movl 25, %eax
50 # DISASM2-NEXT: movl 27, %eax
53 .global foo, foohidden
57 .type foohidden,%object
66 .quad foohidden@SIZE-1
67 .quad foohidden@SIZE+1
75 movl foohidden@SIZE-
1,%eax
76 movl foohidden@SIZE+
1,%eax