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,"aGw",@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
21 leaq foo@GOTTPOFF
(%rip
), %rax
# R_X86_64_GOTTPOFF
22 leaq foo@TLSGD
(%rip
), %rax
# R_X86_64_TLSGD
23 leaq foo@TPOFF
(%rax
), %rax
# R_X86_64_TPOFF32
24 leaq foo@TLSLD
(%rip
), %rdi
# R_X86_64_TLSLD
25 leaq foo@dtpoff
(%rax
), %rcx
# R_X86_64_DTPOFF32
26 movabs foo@GOT
, %rax
# R_X86_64_GOT64
27 movabs foo@GOTOFF
, %rax
# R_X86_64_GOTOFF64
30 leaq foo-bar
(%r14),%r14
31 addq $bar
,%rax
# R_X86_64_32S
33 movabsq $baz@TPOFF
, %rax
38 leaq
-1+foo
(%rip
), %r11
40 leaq _GLOBAL_OFFSET_TABLE_
(%rax
), %r15
41 leaq _GLOBAL_OFFSET_TABLE_
(%rip
), %r15
42 movl $_GLOBAL_OFFSET_TABLE_
, %eax
43 movabs $_GLOBAL_OFFSET_TABLE_
, %rax
45 .quad blah@SIZE # R_X86_64_SIZE64
46 .quad blah@SIZE + 32 # R_X86_64_SIZE64
47 .quad blah@SIZE - 32 # R_X86_64_SIZE64
48 movl blah@SIZE
, %eax
# R_X86_64_SIZE32
49 movl blah@SIZE
+ 32, %eax
# R_X86_64_SIZE32
50 movl blah@SIZE
- 32, %eax
# R_X86_64_SIZE32
55 .quad pr23272_2 - pr23272
56 .quad pr23272_3 - pr23272
60 pr24486_alias
= pr24486
68 .long pr23272-weak_sym
72 // CHECK
: Name
: .rela.text
73 // CHECK
: Relocations
[
74 // CHECK-NEXT
: 0x1 R_X86_64_32
.text
75 // CHECK-NEXT
: 0x8 R_X86_64_32S
.text
76 // CHECK-NEXT
: 0x13 R_X86_64_32S
.text
77 // CHECK-NEXT
: 0x1A R_X86_64_32S
.text
78 // CHECK-NEXT
: 0x22 R_X86_64_32S
.text
79 // CHECK-NEXT
: 0x26 R_X86_64_32
.text
80 // CHECK-NEXT
: 0x2D R_X86_64_GOTTPOFF foo
0xFFFFFFFFFFFFFFFC
81 // CHECK-NEXT
: 0x34 R_X86_64_TLSGD foo
0xFFFFFFFFFFFFFFFC
82 // CHECK-NEXT
: 0x3B R_X86_64_TPOFF32 foo
0x0
83 // CHECK-NEXT
: 0x42 R_X86_64_TLSLD foo
0xFFFFFFFFFFFFFFFC
84 // CHECK-NEXT
: 0x49 R_X86_64_DTPOFF32 foo
0x0
85 // CHECK-NEXT
: 0x4F R_X86_64_GOT64 foo
0x0
86 // CHECK-NEXT
: 0x59 R_X86_64_GOTOFF64 foo
0x0
87 // CHECK-NEXT
: 0x62 R_X86_64_32S
.text 0x0
88 // CHECK-NEXT
: 0x69 R_X86_64_PC32 foo
0xFFFFFFFFFFFFFFFC
89 // CHECK-NEXT
: 0x70 R_X86_64_PC32 foo
0x70
90 // CHECK-NEXT
: 0x77 R_X86_64_32S
.text 0x0
91 // CHECK-NEXT
: 0x7B R_X86_64_DTPOFF64 foo
0x0
92 // CHECK-NEXT
: 0x85 R_X86_64_TPOFF64 baz
0x0
93 // CHECK-NEXT
: 0x8D R_X86_64_PC16 foo
0x8D
94 // CHECK-NEXT
: 0x8F R_X86_64_PC8 foo
0x8F
95 // CHECK-NEXT
: 0x91 R_X86_64_PLT32 foo
0xFFFFFFFFFFFFFFFC
96 // CHECK-NEXT
: 0x98 R_X86_64_PC32 foo
0xFFFFFFFFFFFFFFFB
97 // CHECK-NEXT
: 0x9F R_X86_64_GOTPC32 _GLOBAL_OFFSET_TABLE_
0x3
98 // CHECK-NEXT
: 0xA6 R_X86_64_GOTPC32 _GLOBAL_OFFSET_TABLE_
0xFFFFFFFFFFFFFFFC
99 // CHECK-NEXT
: 0xAB R_X86_64_GOTPC32 _GLOBAL_OFFSET_TABLE_
0x1
100 // CHECK-NEXT
: 0xB1 R_X86_64_GOTPC64 _GLOBAL_OFFSET_TABLE_
0x2
101 // CHECK-NEXT
: 0xB9 R_X86_64_SIZE64 blah
0x0
102 // CHECK-NEXT
: 0xC1 R_X86_64_SIZE64 blah
0x20
103 // CHECK-NEXT
: 0xC9 R_X86_64_SIZE64 blah
0xFFFFFFFFFFFFFFE0
104 // CHECK-NEXT
: 0xD4 R_X86_64_SIZE32 blah
0x0
105 // CHECK-NEXT
: 0xDB R_X86_64_SIZE32 blah
0x20
106 // CHECK-NEXT
: 0xE2 R_X86_64_SIZE32 blah
0xFFFFFFFFFFFFFFE0
107 // CHECK-NEXT
: 0xE6 R_X86_64_GOTPCREL foo
0x0
108 // CHECK-NEXT
: 0xEA R_X86_64_PLT32 foo
0x0
109 // CHECK-NEXT
: 0xFE R_X86_64_32
.text 0xFE
110 // CHECK-NEXT
: 0x103 R_X86_64_PC16 pr23771
0xFFFFFFFFFFFFFFFE
111 // CHECK-NEXT
: 0x105 R_X86_64_PC32 pr23272
0x0
116 // ERR
: [[#@LINE+1]]:7: error: unsupported relocation type