Disallow 64bit relocations in x32 mode.
[binutils.git] / gas / testsuite / gas / i386 / ilp32 / reloc64.s
blob48ce914bd45bc3371096f7a492a8a8d1decaf3e1
1 .macro bad args:vararg
2 .ifdef _bad_
3 \args
4 .endif
5 .endm
7 .macro ill args:vararg
8 # This is used to mark entries that aren't handled consistently,
9 # and thus shouldn't currently be checked for.
10 # \args
11 .endm
13 .text
14 _start:
15 add $xtrn, %rax
16 mov $xtrn, %eax
17 mov $xtrn, %ax
18 mov $xtrn, %al
19 mov xtrn(%rbx), %eax
20 mov xtrn(%ebx), %eax
22 add $(xtrn - .), %rax
23 ill mov $(xtrn - .), %eax
24 mov $(xtrn - .), %ax
25 mov $(xtrn - .), %al
26 mov xtrn(%rip), %eax
27 mov xtrn(%eip), %eax
28 call xtrn
29 jrcxz xtrn
31 add $xtrn@got, %rax
32 bad mov $xtrn@got, %eax
33 bad mov $xtrn@got, %ax
34 bad mov $xtrn@got, %al
35 mov xtrn@got(%rbx), %eax
36 bad mov xtrn@got(%ebx), %eax
37 bad call xtrn@got
39 bad add $xtrn@gotoff, %rax
40 bad mov $xtrn@gotoff, %eax
41 bad mov $xtrn@gotoff, %ax
42 bad mov $xtrn@gotoff, %al
43 bad mov xtrn@gotoff(%rbx), %eax
44 bad mov xtrn@gotoff(%ebx), %eax
45 bad call xtrn@gotoff
47 bad movabs $xtrn@gotpcrel, %rax
48 add $xtrn@gotpcrel, %rax
49 bad mov $xtrn@gotpcrel, %eax
50 bad mov $xtrn@gotpcrel, %ax
51 bad mov $xtrn@gotpcrel, %al
52 mov xtrn@gotpcrel(%rbx), %eax
53 bad mov xtrn@gotpcrel(%ebx), %eax
54 call xtrn@gotpcrel
56 ill movabs $_GLOBAL_OFFSET_TABLE_, %rax
57 add $_GLOBAL_OFFSET_TABLE_, %rax
58 ill add $_GLOBAL_OFFSET_TABLE_, %eax
59 ill add $_GLOBAL_OFFSET_TABLE_, %ax
60 ill add $_GLOBAL_OFFSET_TABLE_, %al
61 lea _GLOBAL_OFFSET_TABLE_(%rip), %rax
62 lea _GLOBAL_OFFSET_TABLE_(%eip), %rax
63 ill movabs $(_GLOBAL_OFFSET_TABLE_ - .), %rax
64 add $(_GLOBAL_OFFSET_TABLE_ - .), %rax
65 ill add $(_GLOBAL_OFFSET_TABLE_ - .), %eax
66 ill add $(_GLOBAL_OFFSET_TABLE_ - .), %ax
67 ill add $(_GLOBAL_OFFSET_TABLE_ - .), %al
69 bad movabs $xtrn@plt, %rax
70 add $xtrn@plt, %rax
71 bad mov $xtrn@plt, %eax
72 bad mov $xtrn@plt, %ax
73 bad mov $xtrn@plt, %al
74 mov xtrn@plt(%rbx), %eax
75 bad mov xtrn@plt(%ebx), %eax
76 call xtrn@plt
77 bad jrcxz xtrn@plt
79 bad movabs $xtrn@tlsgd, %rax
80 add $xtrn@tlsgd, %rax
81 bad mov $xtrn@tlsgd, %eax
82 bad mov $xtrn@tlsgd, %ax
83 bad mov $xtrn@tlsgd, %al
84 mov xtrn@tlsgd(%rbx), %eax
85 bad mov xtrn@tlsgd(%ebx), %eax
86 call xtrn@tlsgd
88 bad movabs $xtrn@gottpoff, %rax
89 add $xtrn@gottpoff, %rax
90 bad mov $xtrn@gottpoff, %eax
91 bad mov $xtrn@gottpoff, %ax
92 bad mov $xtrn@gottpoff, %al
93 mov xtrn@gottpoff(%rbx), %eax
94 bad mov xtrn@gottpoff(%ebx), %eax
95 call xtrn@gottpoff
97 bad movabs $xtrn@tlsld, %rax
98 add $xtrn@tlsld, %rax
99 bad mov $xtrn@tlsld, %eax
100 bad mov $xtrn@tlsld, %ax
101 bad mov $xtrn@tlsld, %al
102 mov xtrn@tlsld(%rbx), %eax
103 bad mov xtrn@tlsld(%ebx), %eax
104 call xtrn@tlsld
106 add $xtrn@dtpoff, %rax
107 bad mov $xtrn@dtpoff, %eax
108 bad mov $xtrn@dtpoff, %ax
109 bad mov $xtrn@dtpoff, %al
110 mov xtrn@dtpoff(%rbx), %eax
111 bad mov xtrn@dtpoff(%ebx), %eax
112 bad call xtrn@dtpoff
114 add $xtrn@tpoff, %rax
115 bad mov $xtrn@tpoff, %eax
116 bad mov $xtrn@tpoff, %ax
117 bad mov $xtrn@tpoff, %al
118 mov xtrn@tpoff(%rbx), %eax
119 bad mov xtrn@tpoff(%ebx), %eax
120 bad call xtrn@tpoff
122 .data
123 .long xtrn
124 .long xtrn - .
125 .long xtrn@got
126 bad .long xtrn@gotoff
127 .long xtrn@gotpcrel
128 .long _GLOBAL_OFFSET_TABLE_
129 .long _GLOBAL_OFFSET_TABLE_ - .
130 .long xtrn@plt
131 .long xtrn@tlsgd
132 .long xtrn@gottpoff
133 .long xtrn@tlsld
134 .long xtrn@dtpoff
135 .long xtrn@tpoff
137 .slong xtrn
138 .slong xtrn - .
139 .slong xtrn@got
140 bad .slong xtrn@gotoff
141 .slong xtrn@gotpcrel
142 .slong _GLOBAL_OFFSET_TABLE_
143 .slong _GLOBAL_OFFSET_TABLE_ - .
144 .slong xtrn@plt
145 .slong xtrn@tlsgd
146 .slong xtrn@gottpoff
147 .slong xtrn@tlsld
148 .slong xtrn@dtpoff
149 .slong xtrn@tpoff
151 .word xtrn
152 .word xtrn - .
153 bad .word xtrn@got
154 bad .word xtrn@gotoff
155 bad .word xtrn@gotpcrel
156 ill .word _GLOBAL_OFFSET_TABLE_
157 ill .word _GLOBAL_OFFSET_TABLE_ - .
158 bad .word xtrn@plt
159 bad .word xtrn@tlsgd
160 bad .word xtrn@gottpoff
161 bad .word xtrn@tlsld
162 bad .word xtrn@dtpoff
163 bad .word xtrn@tpoff
165 .byte xtrn
166 .byte xtrn - .
167 bad .byte xtrn@got
168 bad .byte xtrn@gotoff
169 bad .byte xtrn@gotpcrel
170 ill .byte _GLOBAL_OFFSET_TABLE_
171 ill .byte _GLOBAL_OFFSET_TABLE_ - .
172 bad .byte xtrn@plt
173 bad .byte xtrn@tlsgd
174 bad .byte xtrn@gottpoff
175 bad .byte xtrn@tlsld
176 bad .byte xtrn@dtpoff
177 bad .byte xtrn@tpoff
179 .text
180 mov xtrn@tpoff (%rbx), %eax