1 .macro bad args:vararg
2  .ifdef _bad_
3	\args
4  .endif
5 .endm
6
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
12
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
21
22	add	$(xtrn - .), %rax
23ill	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
30
31	add	$xtrn@got, %rax
32	mov	$xtrn@got, %eax
33bad	mov	$xtrn@got, %ax
34bad	mov	$xtrn@got, %al
35	mov	xtrn@got(%rbx), %eax
36	mov	xtrn@got(%ebx), %eax
37bad	call	xtrn@got
38
39bad	add	$xtrn@gotoff, %rax
40bad	mov	$xtrn@gotoff, %eax
41bad	mov	$xtrn@gotoff, %ax
42bad	mov	$xtrn@gotoff, %al
43bad	mov	xtrn@gotoff(%rbx), %eax
44bad	mov	xtrn@gotoff(%ebx), %eax
45bad	call	xtrn@gotoff
46
47bad	movabs	$xtrn@gotpcrel, %rax
48	add	$xtrn@gotpcrel, %rax
49	mov	$xtrn@gotpcrel, %eax
50bad	mov	$xtrn@gotpcrel, %ax
51bad	mov	$xtrn@gotpcrel, %al
52	mov	xtrn@gotpcrel(%rbx), %eax
53	mov	xtrn@gotpcrel(%ebx), %eax
54	call	xtrn@gotpcrel
55
56ill	movabs	$_GLOBAL_OFFSET_TABLE_, %rax
57	add	$_GLOBAL_OFFSET_TABLE_, %rax
58ill	add	$_GLOBAL_OFFSET_TABLE_, %eax
59ill	add	$_GLOBAL_OFFSET_TABLE_, %ax
60ill	add	$_GLOBAL_OFFSET_TABLE_, %al
61	lea	_GLOBAL_OFFSET_TABLE_(%rip), %rax
62	lea	_GLOBAL_OFFSET_TABLE_(%eip), %rax
63ill	movabs	$(_GLOBAL_OFFSET_TABLE_ - .), %rax
64	add	$(_GLOBAL_OFFSET_TABLE_ - .), %rax
65ill	add	$(_GLOBAL_OFFSET_TABLE_ - .), %eax
66ill	add	$(_GLOBAL_OFFSET_TABLE_ - .), %ax
67ill	add	$(_GLOBAL_OFFSET_TABLE_ - .), %al
68
69bad	movabs	$xtrn@plt, %rax
70	add	$xtrn@plt, %rax
71	mov	$xtrn@plt, %eax
72bad	mov	$xtrn@plt, %ax
73bad	mov	$xtrn@plt, %al
74	mov	xtrn@plt(%rbx), %eax
75	mov	xtrn@plt(%ebx), %eax
76	call	xtrn@plt
77bad	jrcxz	xtrn@plt
78
79bad	movabs	$xtrn@tlsgd, %rax
80	add	$xtrn@tlsgd, %rax
81	mov	$xtrn@tlsgd, %eax
82bad	mov	$xtrn@tlsgd, %ax
83bad	mov	$xtrn@tlsgd, %al
84	mov	xtrn@tlsgd(%rbx), %eax
85	mov	xtrn@tlsgd(%ebx), %eax
86	call	xtrn@tlsgd
87
88bad	movabs	$xtrn@gottpoff, %rax
89	add	$xtrn@gottpoff, %rax
90	mov	$xtrn@gottpoff, %eax
91bad	mov	$xtrn@gottpoff, %ax
92bad	mov	$xtrn@gottpoff, %al
93	mov	xtrn@gottpoff(%rbx), %eax
94	mov	xtrn@gottpoff(%ebx), %eax
95	call	xtrn@gottpoff
96
97bad	movabs	$xtrn@tlsld, %rax
98	add	$xtrn@tlsld, %rax
99	mov	$xtrn@tlsld, %eax
100bad	mov	$xtrn@tlsld, %ax
101bad	mov	$xtrn@tlsld, %al
102	mov	xtrn@tlsld(%rbx), %eax
103	mov	xtrn@tlsld(%ebx), %eax
104	call	xtrn@tlsld
105
106	add	$xtrn@dtpoff, %rax
107	mov	$xtrn@dtpoff, %eax
108bad	mov	$xtrn@dtpoff, %ax
109bad	mov	$xtrn@dtpoff, %al
110	mov	xtrn@dtpoff(%rbx), %eax
111	mov	xtrn@dtpoff(%ebx), %eax
112bad	call	xtrn@dtpoff
113
114	add	$xtrn@tpoff, %rax
115	mov	$xtrn@tpoff, %eax
116bad	mov	$xtrn@tpoff, %ax
117bad	mov	$xtrn@tpoff, %al
118	mov	xtrn@tpoff(%rbx), %eax
119	mov	xtrn@tpoff(%ebx), %eax
120bad	call	xtrn@tpoff
121
122 .data
123	.long	xtrn
124	.long	xtrn - .
125	.long	xtrn@got
126bad	.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
136
137	.slong	xtrn
138	.slong	xtrn - .
139	.slong	xtrn@got
140bad	.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
150
151	.word	xtrn
152	.word	xtrn - .
153bad	.word	xtrn@got
154bad	.word	xtrn@gotoff
155bad	.word	xtrn@gotpcrel
156ill	.word	_GLOBAL_OFFSET_TABLE_
157ill	.word	_GLOBAL_OFFSET_TABLE_ - .
158bad	.word	xtrn@plt
159bad	.word	xtrn@tlsgd
160bad	.word	xtrn@gottpoff
161bad	.word	xtrn@tlsld
162bad	.word	xtrn@dtpoff
163bad	.word	xtrn@tpoff
164
165	.byte	xtrn
166	.byte	xtrn - .
167bad	.byte	xtrn@got
168bad	.byte	xtrn@gotoff
169bad	.byte	xtrn@gotpcrel
170ill	.byte	_GLOBAL_OFFSET_TABLE_
171ill	.byte	_GLOBAL_OFFSET_TABLE_ - .
172bad	.byte	xtrn@plt
173bad	.byte	xtrn@tlsgd
174bad	.byte	xtrn@gottpoff
175bad	.byte	xtrn@tlsld
176bad	.byte	xtrn@dtpoff
177bad	.byte	xtrn@tpoff
178
179	.text
180	mov	xtrn@tpoff (%rbx), %eax
181	movabsq	$xtrn - 4294967295, %rbp
182
183	.data
184	.quad	xtrn
185	.quad	xtrn + 0x7fffffff
186	.quad	xtrn - 0x80000000
187	.long	xtrn@got - 4
188	.long	xtrn@got + 4
189