]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/relocation-local.s
Vendor import of lld trunk r290819:
[FreeBSD/FreeBSD.git] / test / ELF / relocation-local.s
1 // Test that relocation of local symbols is working.
2 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
3 // RUN: ld.lld %t -o %t2
4 // RUN: llvm-objdump -s -d %t2 | FileCheck %s
5 // REQUIRES: x86
6
7
8 .global _start
9 _start:
10   call lulz
11
12 .zero 4
13 lulz:
14
15 .section       .text2,"ax",@progbits
16 R_X86_64_32:
17   movl $R_X86_64_32, %edx
18
19 // FIXME: this would be far more self evident if llvm-objdump printed
20 // constants in hex.
21 // CHECK: Disassembly of section .text2:
22 // CHECK-NEXT: R_X86_64_32:
23 // CHECK-NEXT:  201009: {{.*}} movl $2101257, %edx
24
25 .section .R_X86_64_32S,"ax",@progbits
26 R_X86_64_32S:
27   movq lulz - 0x100000, %rdx
28
29 // CHECK: Disassembly of section .R_X86_64_32S:
30 // CHECK-NEXT: R_X86_64_32S:
31 // CHECK-NEXT:  {{.*}}: {{.*}} movq 1052681, %rdx
32
33 .section .R_X86_64_64,"a",@progbits
34 R_X86_64_64:
35  .quad R_X86_64_64
36
37 // CHECK:      Contents of section .R_X86_64_64:
38 // CHECK-NEXT:   200120 20012000 00000000