llvm.org GIT mirror llvm / 396ee55
[JITLink] Move MachO/x86 got test further down in the data section. 'named_data' should be the first symbol in the data section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374475 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 1 year, 1 month ago
1 changed file(s) with 143 addition(s) and 143 deletion(s). Raw diff Collapse all Expand all
128128 Lanon_minuend_long:
129129 .long Lanon_minuend_long - named_data + 2
130130
131 # Named quad storage target (first named atom in __data).
132 .globl named_data
133 .p2align 3
134 named_data:
135 .quad 0x2222222222222222
136
137 # An alt-entry point for named_data
138 .globl named_data_alt_entry
139 .p2align 3
140 .alt_entry named_data_alt_entry
141 named_data_alt_entry:
142 .quad 0
143
144 # Check X86_64_RELOC_UNSIGNED / quad / extern handling by putting the address of
145 # a local named function into a quad symbol.
146 #
147 # jitlink-check: *{8}named_func_addr_quad = named_func
148 .globl named_func_addr_quad
149 .p2align 3
150 named_func_addr_quad:
151 .quad named_func
152
153 # Check X86_64_RELOC_UNSIGNED / long / extern handling by putting the address of
154 # an external function (defined to reside in the low 4Gb) into a long symbol.
155 #
156 # jitlink-check: *{4}named_func_addr_long = external_func
157 .globl named_func_addr_long
158 .p2align 2
159 named_func_addr_long:
160 .long external_func
161
162 # Check X86_64_RELOC_UNSIGNED / quad / non-extern handling by putting the
163 # address of a local anonymous function into a quad symbol.
164 #
165 # jitlink-check: *{8}anon_func_addr_quad = section_addr(macho_reloc.o, __text)
166 .globl anon_func_addr_quad
167 .p2align 3
168 anon_func_addr_quad:
169 .quad Lanon_func
170
171 # X86_64_RELOC_SUBTRACTOR Quad/Long in named storage with anonymous minuend
172 #
173 # jitlink-check: *{8}anon_minuend_quad1 = section_addr(macho_reloc.o, __data) - anon_minuend_quad1 + 2
174 # Only the form "B: .quad LA - B + C" is tested. The form "B: .quad B - LA + C" is
175 # invalid because the subtrahend can not be local.
176 .globl anon_minuend_quad1
177 .p2align 3
178 anon_minuend_quad1:
179 .quad Lanon_data - anon_minuend_quad1 + 2
180
181 # jitlink-check: *{4}anon_minuend_long1 = (section_addr(macho_reloc.o, __data) - anon_minuend_long1 + 2)[31:0]
182 .globl anon_minuend_long1
183 .p2align 2
184 anon_minuend_long1:
185 .long Lanon_data - anon_minuend_long1 + 2
186
187 # Check X86_64_RELOC_SUBTRACTOR Quad/Long in named storage with minuend and subtrahend.
188 # Both forms "A: .quad A - B + C" and "A: .quad B - A + C" are tested.
189 #
190 # Check "A: .quad B - A + C".
191 # jitlink-check: *{8}subtrahend_quad2 = (named_data - subtrahend_quad2 - 2)
192 .globl subtrahend_quad2
193 .p2align 3
194 subtrahend_quad2:
195 .quad named_data - subtrahend_quad2 - 2
196
197 # Check "A: .long B - A + C".
198 # jitlink-check: *{4}subtrahend_long2 = (named_data - subtrahend_long2 - 2)[31:0]
199 .globl subtrahend_long2
200 .p2align 2
201 subtrahend_long2:
202 .long named_data - subtrahend_long2 - 2
203
204 # Check "A: .quad A - B + C".
205 # jitlink-check: *{8}minuend_quad3 = (minuend_quad3 - named_data - 2)
206 .globl minuend_quad3
207 .p2align 3
208 minuend_quad3:
209 .quad minuend_quad3 - named_data - 2
210
211 # Check "A: .long B - A + C".
212 # jitlink-check: *{4}minuend_long3 = (minuend_long3 - named_data - 2)[31:0]
213 .globl minuend_long3
214 .p2align 2
215 minuend_long3:
216 .long minuend_long3 - named_data - 2
217
218 # Check X86_64_RELOC_SUBTRACTOR handling for exprs of the form
219 # "A: .quad/long B - C + D", where 'B' or 'C' is at a fixed offset from 'A'
220 # (i.e. is part of an alt_entry chain that includes 'A').
221 #
222 # Check "A: .long B - C + D" where 'B' is an alt_entry for 'A'.
223 # jitlink-check: *{4}subtractor_with_alt_entry_minuend_long = (subtractor_with_alt_entry_minuend_long_B - named_data + 2)[31:0]
224 .globl subtractor_with_alt_entry_minuend_long
225 .p2align 2
226 subtractor_with_alt_entry_minuend_long:
227 .long subtractor_with_alt_entry_minuend_long_B - named_data + 2
228
229 .globl subtractor_with_alt_entry_minuend_long_B
230 .p2align 2
231 .alt_entry subtractor_with_alt_entry_minuend_long_B
232 subtractor_with_alt_entry_minuend_long_B:
233 .long 0
234
235 # Check "A: .quad B - C + D" where 'B' is an alt_entry for 'A'.
236 # jitlink-check: *{8}subtractor_with_alt_entry_minuend_quad = (subtractor_with_alt_entry_minuend_quad_B - named_data + 2)
237 .globl subtractor_with_alt_entry_minuend_quad
238 .p2align 3
239 subtractor_with_alt_entry_minuend_quad:
240 .quad subtractor_with_alt_entry_minuend_quad_B - named_data + 2
241
242 .globl subtractor_with_alt_entry_minuend_quad_B
243 .p2align 3
244 .alt_entry subtractor_with_alt_entry_minuend_quad_B
245 subtractor_with_alt_entry_minuend_quad_B:
246 .quad 0
247
248 # Check "A: .long B - C + D" where 'C' is an alt_entry for 'A'.
249 # jitlink-check: *{4}subtractor_with_alt_entry_subtrahend_long = (named_data - subtractor_with_alt_entry_subtrahend_long_B + 2)[31:0]
250 .globl subtractor_with_alt_entry_subtrahend_long
251 .p2align 2
252 subtractor_with_alt_entry_subtrahend_long:
253 .long named_data - subtractor_with_alt_entry_subtrahend_long_B + 2
254
255 .globl subtractor_with_alt_entry_subtrahend_long_B
256 .p2align 2
257 .alt_entry subtractor_with_alt_entry_subtrahend_long_B
258 subtractor_with_alt_entry_subtrahend_long_B:
259 .long 0
260
261 # Check "A: .quad B - C + D" where 'B' is an alt_entry for 'A'.
262 # jitlink-check: *{8}subtractor_with_alt_entry_subtrahend_quad = (named_data - subtractor_with_alt_entry_subtrahend_quad_B + 2)
263 .globl subtractor_with_alt_entry_subtrahend_quad
264 .p2align 3
265 subtractor_with_alt_entry_subtrahend_quad:
266 .quad named_data - subtractor_with_alt_entry_subtrahend_quad_B + 2
267
268 .globl subtractor_with_alt_entry_subtrahend_quad_B
269 .p2align 3
270 .alt_entry subtractor_with_alt_entry_subtrahend_quad_B
271 subtractor_with_alt_entry_subtrahend_quad_B:
272 .quad 0
273
131274 # Check X86_64_RELOC_GOT handling.
132275 # X86_64_RELOC_GOT is the data-section counterpart to X86_64_RELOC_GOTLD. It is
133276 # handled exactly the same way, including having an implicit PC-rel offset of -4
140283 test_got:
141284 .long external_data@GOTPCREL + 4
142285
143 # Named quad storage target (first named atom in __data).
144 .globl named_data
145 .p2align 3
146 named_data:
147 .quad 0x2222222222222222
148
149 # An alt-entry point for named_data
150 .globl named_data_alt_entry
151 .p2align 3
152 .alt_entry named_data_alt_entry
153 named_data_alt_entry:
154 .quad 0
155
156 # Check X86_64_RELOC_UNSIGNED / quad / extern handling by putting the address of
157 # a local named function into a quad symbol.
158 #
159 # jitlink-check: *{8}named_func_addr_quad = named_func
160 .globl named_func_addr_quad
161 .p2align 3
162 named_func_addr_quad:
163 .quad named_func
164
165 # Check X86_64_RELOC_UNSIGNED / long / extern handling by putting the address of
166 # an external function (defined to reside in the low 4Gb) into a long symbol.
167 #
168 # jitlink-check: *{4}named_func_addr_long = external_func
169 .globl named_func_addr_long
170 .p2align 2
171 named_func_addr_long:
172 .long external_func
173
174 # Check X86_64_RELOC_UNSIGNED / quad / non-extern handling by putting the
175 # address of a local anonymous function into a quad symbol.
176 #
177 # jitlink-check: *{8}anon_func_addr_quad = section_addr(macho_reloc.o, __text)
178 .globl anon_func_addr_quad
179 .p2align 3
180 anon_func_addr_quad:
181 .quad Lanon_func
182
183 # X86_64_RELOC_SUBTRACTOR Quad/Long in named storage with anonymous minuend
184 #
185 # jitlink-check: *{8}anon_minuend_quad1 = section_addr(macho_reloc.o, __data) - anon_minuend_quad1 + 2
186 # Only the form "B: .quad LA - B + C" is tested. The form "B: .quad B - LA + C" is
187 # invalid because the subtrahend can not be local.
188 .globl anon_minuend_quad1
189 .p2align 3
190 anon_minuend_quad1:
191 .quad Lanon_data - anon_minuend_quad1 + 2
192
193 # jitlink-check: *{4}anon_minuend_long1 = (section_addr(macho_reloc.o, __data) - anon_minuend_long1 + 2)[31:0]
194 .globl anon_minuend_long1
195 .p2align 2
196 anon_minuend_long1:
197 .long Lanon_data - anon_minuend_long1 + 2
198
199 # Check X86_64_RELOC_SUBTRACTOR Quad/Long in named storage with minuend and subtrahend.
200 # Both forms "A: .quad A - B + C" and "A: .quad B - A + C" are tested.
201 #
202 # Check "A: .quad B - A + C".
203 # jitlink-check: *{8}subtrahend_quad2 = (named_data - subtrahend_quad2 - 2)
204 .globl subtrahend_quad2
205 .p2align 3
206 subtrahend_quad2:
207 .quad named_data - subtrahend_quad2 - 2
208
209 # Check "A: .long B - A + C".
210 # jitlink-check: *{4}subtrahend_long2 = (named_data - subtrahend_long2 - 2)[31:0]
211 .globl subtrahend_long2
212 .p2align 2
213 subtrahend_long2:
214 .long named_data - subtrahend_long2 - 2
215
216 # Check "A: .quad A - B + C".
217 # jitlink-check: *{8}minuend_quad3 = (minuend_quad3 - named_data - 2)
218 .globl minuend_quad3
219 .p2align 3
220 minuend_quad3:
221 .quad minuend_quad3 - named_data - 2
222
223 # Check "A: .long B - A + C".
224 # jitlink-check: *{4}minuend_long3 = (minuend_long3 - named_data - 2)[31:0]
225 .globl minuend_long3
226 .p2align 2
227 minuend_long3:
228 .long minuend_long3 - named_data - 2
229
230 # Check X86_64_RELOC_SUBTRACTOR handling for exprs of the form
231 # "A: .quad/long B - C + D", where 'B' or 'C' is at a fixed offset from 'A'
232 # (i.e. is part of an alt_entry chain that includes 'A').
233 #
234 # Check "A: .long B - C + D" where 'B' is an alt_entry for 'A'.
235 # jitlink-check: *{4}subtractor_with_alt_entry_minuend_long = (subtractor_with_alt_entry_minuend_long_B - named_data + 2)[31:0]
236 .globl subtractor_with_alt_entry_minuend_long
237 .p2align 2
238 subtractor_with_alt_entry_minuend_long:
239 .long subtractor_with_alt_entry_minuend_long_B - named_data + 2
240
241 .globl subtractor_with_alt_entry_minuend_long_B
242 .p2align 2
243 .alt_entry subtractor_with_alt_entry_minuend_long_B
244 subtractor_with_alt_entry_minuend_long_B:
245 .long 0
246
247 # Check "A: .quad B - C + D" where 'B' is an alt_entry for 'A'.
248 # jitlink-check: *{8}subtractor_with_alt_entry_minuend_quad = (subtractor_with_alt_entry_minuend_quad_B - named_data + 2)
249 .globl subtractor_with_alt_entry_minuend_quad
250 .p2align 3
251 subtractor_with_alt_entry_minuend_quad:
252 .quad subtractor_with_alt_entry_minuend_quad_B - named_data + 2
253
254 .globl subtractor_with_alt_entry_minuend_quad_B
255 .p2align 3
256 .alt_entry subtractor_with_alt_entry_minuend_quad_B
257 subtractor_with_alt_entry_minuend_quad_B:
258 .quad 0
259
260 # Check "A: .long B - C + D" where 'C' is an alt_entry for 'A'.
261 # jitlink-check: *{4}subtractor_with_alt_entry_subtrahend_long = (named_data - subtractor_with_alt_entry_subtrahend_long_B + 2)[31:0]
262 .globl subtractor_with_alt_entry_subtrahend_long
263 .p2align 2
264 subtractor_with_alt_entry_subtrahend_long:
265 .long named_data - subtractor_with_alt_entry_subtrahend_long_B + 2
266
267 .globl subtractor_with_alt_entry_subtrahend_long_B
268 .p2align 2
269 .alt_entry subtractor_with_alt_entry_subtrahend_long_B
270 subtractor_with_alt_entry_subtrahend_long_B:
271 .long 0
272
273 # Check "A: .quad B - C + D" where 'B' is an alt_entry for 'A'.
274 # jitlink-check: *{8}subtractor_with_alt_entry_subtrahend_quad = (named_data - subtractor_with_alt_entry_subtrahend_quad_B + 2)
275 .globl subtractor_with_alt_entry_subtrahend_quad
276 .p2align 3
277 subtractor_with_alt_entry_subtrahend_quad:
278 .quad named_data - subtractor_with_alt_entry_subtrahend_quad_B + 2
279
280 .globl subtractor_with_alt_entry_subtrahend_quad_B
281 .p2align 3
282 .alt_entry subtractor_with_alt_entry_subtrahend_quad_B
283 subtractor_with_alt_entry_subtrahend_quad_B:
284 .quad 0
285
286286 # Check that unreferenced atoms in no-dead-strip sections are not dead stripped.
287287 # We need to use a local symbol for this as any named symbol will end up in the
288288 # ORC responsibility set, which is automatically marked live and would couse