1 // RUN
: llvm-mc
-filetype
=obj
-triple x86_64-pc-linux-gnu
%s
-o
- | llvm-readobj
-S
--sr - | FileCheck
%s
2 // RUN
: not llvm-mc
-filetype
=obj
-triple x86_64
--defsym ERR
=1 %s
-o
/dev
/null
2>&1 | FileCheck
%s
--check-prefix
=ERR
--implicit-check-
not=error
:
4 // Test that we produce the correct relocation.
7 .section .pr23272,"awG",@progbits,pr23272,comdat
15 movl $bar
, %edx
# R_X86_64_32
16 movq $bar
, %rdx
# R_X86_64_32S
17 movq $bar
, bar
(%rip
) # R_X86_64_32S
18 movl bar
, %edx
# R_X86_64_32S
19 movq bar
, %rdx
# R_X86_64_32S
20 .long bar # R_X86_64_32
25 leaq foo-bar
(%r14),%r14
26 addq $bar
,%rax
# R_X86_64_32S
31 leaq
-1+foo
(%rip
), %r11
33 leaq _GLOBAL_OFFSET_TABLE_
(%rax
), %r15
34 leaq _GLOBAL_OFFSET_TABLE_
(%rip
), %r15
35 movl $_GLOBAL_OFFSET_TABLE_
, %eax
36 movabs $_GLOBAL_OFFSET_TABLE_
, %rax
41 .quad pr23272_2 - pr23272
42 .quad pr23272_3 - pr23272
46 pr24486_alias
= pr24486
54 .long pr23272-weak_sym
57 // CHECK
: Name
: .rela.text
58 // CHECK
: Relocations
[
59 // CHECK-NEXT
: 0x1 R_X86_64_32
.text 0x0
60 // CHECK-NEXT
: 0x8 R_X86_64_32S
.text 0x0
61 // CHECK-NEXT
: 0x13 R_X86_64_32S
.text 0x0
62 // CHECK-NEXT
: 0x1A R_X86_64_32S
.text 0x0
63 // CHECK-NEXT
: 0x22 R_X86_64_32S
.text 0x0
64 // CHECK-NEXT
: 0x26 R_X86_64_32
.text 0x0
65 // CHECK-NEXT
: 0x3F R_X86_64_32S
.text 0x0
66 // CHECK-NEXT
: 0x46 R_X86_64_PC32 foo
0xFFFFFFFFFFFFFFFC
67 // CHECK-NEXT
: 0x4D R_X86_64_PC32 foo
0x4D
68 // CHECK-NEXT
: 0x54 R_X86_64_32S
.text 0x0
69 // CHECK-NEXT
: 0x58 R_X86_64_PC16 foo
0x58
70 // CHECK-NEXT
: 0x5A R_X86_64_PC8 foo
0x5A
71 // CHECK-NEXT
: 0x5C R_X86_64_PLT32 foo
0xFFFFFFFFFFFFFFFC
72 // CHECK-NEXT
: 0x63 R_X86_64_PC32 foo
0xFFFFFFFFFFFFFFFB
73 // CHECK-NEXT
: 0x6A R_X86_64_GOTPC32 _GLOBAL_OFFSET_TABLE_
0x3
74 // CHECK-NEXT
: 0x71 R_X86_64_GOTPC32 _GLOBAL_OFFSET_TABLE_
0xFFFFFFFFFFFFFFFC
75 // CHECK-NEXT
: 0x76 R_X86_64_GOTPC32 _GLOBAL_OFFSET_TABLE_
0x1
76 // CHECK-NEXT
: 0x7C R_X86_64_GOTPC64 _GLOBAL_OFFSET_TABLE_
0x2
77 // CHECK-NEXT
: 0x84 R_X86_64_GOTPCREL foo
0x0
78 // CHECK-NEXT
: 0x88 R_X86_64_PLT32 foo
0x0
79 // CHECK-NEXT
: 0x9C R_X86_64_32
.text 0x9C
80 // CHECK-NEXT
: 0xA1 R_X86_64_PC16 pr23771
0xFFFFFFFFFFFFFFFE
81 // CHECK-NEXT
: 0xA3 R_X86_64_PC32 pr23272
0x0
86 // ERR
: [[#@LINE+1]]:7: error: unsupported relocation type