aboutsummaryrefslogtreecommitdiff
path: root/lld/test/COFF/arm64x-delayimport.test
blob: 2a68bce79baad9627b1776c97b080b1cb8735122 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
REQUIRES: aarch64, x86
RUN: split-file %s %t.dir && cd %t.dir

RUN: llvm-mc -filetype=obj -triple=arm64ec-windows test-arm64ec.s -o test-arm64ec.obj
RUN: llvm-mc -filetype=obj -triple=aarch64-windows test-arm64.s -o test-arm64.obj
RUN: llvm-mc -filetype=obj -triple=arm64ec-windows arm64ec-helper.s -o arm64ec-helper.obj
RUN: llvm-mc -filetype=obj -triple=aarch64-windows arm64-helper.s -o arm64-helper.obj
RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o loadconfig-arm64ec.obj
RUN: llvm-mc -filetype=obj -triple=aarch64-windows %S/Inputs/loadconfig-arm64.s -o loadconfig-arm64.obj
RUN: llvm-lib -machine:arm64ec -def:test.def -out:test-arm64ec.lib
RUN: llvm-lib -machine:arm64 -def:test.def -out:test-arm64.lib

# Test delayed-load import from both native and EC code.

RUN: lld-link -machine:arm64x -dll -noentry -out:out.dll loadconfig-arm64.obj loadconfig-arm64ec.obj \
RUN:          arm64-helper.obj arm64ec-helper.obj test-arm64.obj test-arm64ec.obj test-arm64.lib test-arm64ec.lib -delayload:test.dll

RUN: llvm-readobj --coff-imports out.dll | FileCheck --check-prefix=IMPORTS %s
IMPORTS:      DelayImport {
IMPORTS-NEXT:   Name: test.dll
IMPORTS-NEXT:   Attributes: 0x1
IMPORTS-NEXT:   ModuleHandle: 0x6080
IMPORTS-NEXT:   ImportAddressTable: 0x6088
IMPORTS-NEXT:   ImportNameTable: 0x4388
IMPORTS-NEXT:   BoundDelayImportTable: 0x0
IMPORTS-NEXT:   UnloadDelayImportTable: 0x0
IMPORTS-NEXT:   Import {
IMPORTS-NEXT:     Symbol: func (0)
IMPORTS-NEXT:     Address: 0x180001014
IMPORTS-NEXT:   }
IMPORTS-NEXT: }
IMPORTS-NEXT: HybridObject {
IMPORTS:        DelayImport {
IMPORTS-NEXT:     Name: test.dll
IMPORTS-NEXT:     Attributes: 0x1
IMPORTS-NEXT:     ModuleHandle: 0x6080
IMPORTS-NEXT:     ImportAddressTable: 0x6098
IMPORTS-NEXT:     ImportNameTable: 0x4398
IMPORTS-NEXT:     BoundDelayImportTable: 0x0
IMPORTS-NEXT:     UnloadDelayImportTable: 0x0
IMPORTS-NEXT:     Import {
IMPORTS-NEXT:       Symbol: func (0)
IMPORTS-NEXT:       Address: 0x180003006
IMPORTS-NEXT:     }
IMPORTS-NEXT:   }
IMPORTS-NEXT: }

RUN: llvm-readobj --hex-dump=.test out.dll | FileCheck --check-prefix=TESTSEC %s
TESTSEC: 0x180009000 10500000 98600000 00300000 10200000

RUN: llvm-readobj --hex-dump=.testa out.dll | FileCheck --check-prefix=TESTSECA %s
TESTSECA: 0x18000a000 88600000 08100000

RUN: llvm-objdump -d out.dll | FileCheck --check-prefix=DISASM %s
DISASM:      0000000180001000 <.text>:
DISASM-NEXT: 180001000: 52800060     mov     w0, #0x3                // =3
DISASM-NEXT: 180001004: d65f03c0     ret
DISASM-NEXT: 180001008: b0000030     adrp    x16, 0x180006000
DISASM-NEXT: 18000100c: f9404610     ldr     x16, [x16, #0x88]
DISASM-NEXT: 180001010: d61f0200     br      x16
DISASM-NEXT: 180001014: b0000031     adrp    x17, 0x180006000
DISASM-NEXT: 180001018: 91022231     add     x17, x17, #0x88
DISASM-NEXT: 18000101c: 14000001     b       0x180001020 <.text+0x20>
DISASM-NEXT: 180001020: a9b37bfd     stp     x29, x30, [sp, #-0xd0]!
DISASM-NEXT: 180001024: 910003fd     mov     x29, sp
DISASM-NEXT: 180001028: a90107e0     stp     x0, x1, [sp, #0x10]
DISASM-NEXT: 18000102c: a9020fe2     stp     x2, x3, [sp, #0x20]
DISASM-NEXT: 180001030: a90317e4     stp     x4, x5, [sp, #0x30]
DISASM-NEXT: 180001034: a9041fe6     stp     x6, x7, [sp, #0x40]
DISASM-NEXT: 180001038: ad0287e0     stp     q0, q1, [sp, #0x50]
DISASM-NEXT: 18000103c: ad038fe2     stp     q2, q3, [sp, #0x70]
DISASM-NEXT: 180001040: ad0497e4     stp     q4, q5, [sp, #0x90]
DISASM-NEXT: 180001044: ad059fe6     stp     q6, q7, [sp, #0xb0]
DISASM-NEXT: 180001048: aa1103e1     mov     x1, x17
DISASM-NEXT: 18000104c: f0000000     adrp    x0, 0x180004000
DISASM-NEXT: 180001050: 910d2000     add     x0, x0, #0x348
DISASM-NEXT: 180001054: 97ffffeb     bl      0x180001000 <.text>
DISASM-NEXT: 180001058: aa0003f0     mov     x16, x0
DISASM-NEXT: 18000105c: ad459fe6     ldp     q6, q7, [sp, #0xb0]
DISASM-NEXT: 180001060: ad4497e4     ldp     q4, q5, [sp, #0x90]
DISASM-NEXT: 180001064: ad438fe2     ldp     q2, q3, [sp, #0x70]
DISASM-NEXT: 180001068: ad4287e0     ldp     q0, q1, [sp, #0x50]
DISASM-NEXT: 18000106c: a9441fe6     ldp     x6, x7, [sp, #0x40]
DISASM-NEXT: 180001070: a94317e4     ldp     x4, x5, [sp, #0x30]
DISASM-NEXT: 180001074: a9420fe2     ldp     x2, x3, [sp, #0x20]
DISASM-NEXT: 180001078: a94107e0     ldp     x0, x1, [sp, #0x10]
DISASM-NEXT: 18000107c: a8cd7bfd     ldp     x29, x30, [sp], #0xd0
DISASM-NEXT: 180001080: d61f0200     br      x16
DISASM-NEXT:                 ...
DISASM-NEXT: 180002000: 52800040     mov     w0, #0x2                // =2
DISASM-NEXT: 180002004: d65f03c0     ret
DISASM-NEXT: 180002008: 52800060     mov     w0, #0x3                // =3
DISASM-NEXT: 18000200c: d65f03c0     ret
DISASM-NEXT: 180002010: f0000010     adrp    x16, 0x180005000
DISASM-NEXT: 180002014: f9400a10     ldr     x16, [x16, #0x10]
DISASM-NEXT: 180002018: d61f0200     br      x16
DISASM-NEXT: 18000201c: 9000002b     adrp    x11, 0x180006000
DISASM-NEXT: 180002020: f9404d6b     ldr     x11, [x11, #0x98]
DISASM-NEXT: 180002024: 9000000a     adrp    x10, 0x180002000 <.text+0x1000>
DISASM-NEXT: 180002028: 9100c14a     add     x10, x10, #0x30
DISASM-NEXT: 18000202c: 17fffff5     b       0x180002000 <.text+0x1000>
DISASM-NEXT: 180002030: 52800080     mov     w0, #0x4                // =4
DISASM-NEXT: 180002034: d65f03c0     ret
DISASM-NEXT:                 ...
DISASM-NEXT: 180003000: ff 25 92 30 00 00            jmpq    *0x3092(%rip)           # 0x180006098
DISASM-NEXT: 180003006: 48 8d 05 8b 30 00 00         leaq    0x308b(%rip), %rax      # 0x180006098
DISASM-NEXT: 18000300d: e9 00 00 00 00               jmp     0x180003012 <.text+0x2012>
DISASM-NEXT: 180003012: 48 89 4c 24 08               movq    %rcx, 0x8(%rsp)
DISASM-NEXT: 180003017: 48 89 54 24 10               movq    %rdx, 0x10(%rsp)
DISASM-NEXT: 18000301c: 4c 89 44 24 18               movq    %r8, 0x18(%rsp)
DISASM-NEXT: 180003021: 4c 89 4c 24 20               movq    %r9, 0x20(%rsp)
DISASM-NEXT: 180003026: 48 83 ec 68                  subq    $0x68, %rsp
DISASM-NEXT: 18000302a: 66 0f 7f 44 24 20            movdqa  %xmm0, 0x20(%rsp)
DISASM-NEXT: 180003030: 66 0f 7f 4c 24 30            movdqa  %xmm1, 0x30(%rsp)
DISASM-NEXT: 180003036: 66 0f 7f 54 24 40            movdqa  %xmm2, 0x40(%rsp)
DISASM-NEXT: 18000303c: 66 0f 7f 5c 24 50            movdqa  %xmm3, 0x50(%rsp)
DISASM-NEXT: 180003042: 48 8b d0                     movq    %rax, %rdx
DISASM-NEXT: 180003045: 48 8d 0d fc 12 00 00         leaq    0x12fc(%rip), %rcx      # 0x180004348
DISASM-NEXT: 18000304c: e8 b7 ef ff ff               callq   0x180002008 <.text+0x1008>
DISASM-NEXT: 180003051: 66 0f 6f 44 24 20            movdqa  0x20(%rsp), %xmm0
DISASM-NEXT: 180003057: 66 0f 6f 4c 24 30            movdqa  0x30(%rsp), %xmm1
DISASM-NEXT: 18000305d: 66 0f 6f 54 24 40            movdqa  0x40(%rsp), %xmm2
DISASM-NEXT: 180003063: 66 0f 6f 5c 24 50            movdqa  0x50(%rsp), %xmm3
DISASM-NEXT: 180003069: 48 8b 4c 24 70               movq    0x70(%rsp), %rcx
DISASM-NEXT: 18000306e: 48 8b 54 24 78               movq    0x78(%rsp), %rdx
DISASM-NEXT: 180003073: 4c 8b 84 24 80 00 00 00      movq    0x80(%rsp), %r8
DISASM-NEXT: 18000307b: 4c 8b 8c 24 88 00 00 00      movq    0x88(%rsp), %r9
DISASM-NEXT: 180003083: 48 83 c4 68                  addq    $0x68, %rsp
DISASM-NEXT: 180003087: ff e0                        jmpq    *%rax

RUN: llvm-readobj --coff-load-config out.dll | FileCheck --check-prefix=LOADCFG %s
LOADCFG:      AuxiliaryDelayloadIAT: 0x5000
LOADCFG-NEXT: AuxiliaryDelayloadIATCopy: 0x4140

RUN: llvm-readobj --hex-dump=.rdata out.dll | FileCheck --check-prefix=AUXIAT %s
AUXIAT:      0x180005000 00000000 00000000 00000000 00000000
AUXIAT-NEXT: 0x180005010 1c200080 01000000 00000000 00000000


# Test delayed-load import from native code only.

RUN: lld-link -machine:arm64x -dll -noentry -out:out-native.dll loadconfig-arm64.obj loadconfig-arm64ec.obj \
RUN:          arm64-helper.obj arm64ec-helper.obj test-arm64.obj test-arm64.lib test-arm64ec.lib -delayload:test.dll

RUN: llvm-readobj --coff-imports out-native.dll | FileCheck --check-prefix=NATIVE-IMPORTS %s
NATIVE-IMPORTS:      DelayImport {
NATIVE-IMPORTS-NEXT:   Name: test.dll
NATIVE-IMPORTS-NEXT:   Attributes: 0x1
NATIVE-IMPORTS-NEXT:   ModuleHandle: 0x5080
NATIVE-IMPORTS-NEXT:   ImportAddressTable: 0x5088
NATIVE-IMPORTS-NEXT:   ImportNameTable: 0x3370
NATIVE-IMPORTS-NEXT:   BoundDelayImportTable: 0x0
NATIVE-IMPORTS-NEXT:   UnloadDelayImportTable: 0x0
NATIVE-IMPORTS-NEXT:   Import {
NATIVE-IMPORTS-NEXT:     Symbol: func (0)
NATIVE-IMPORTS-NEXT:     Address: 0x180001014
NATIVE-IMPORTS-NEXT:   }
NATIVE-IMPORTS-NEXT: }
NATIVE-IMPORTS-NEXT: HybridObject {
NATIVE-IMPORTS-NEXT:   Format: COFF-ARM64EC
NATIVE-IMPORTS-NEXT:   Arch: aarch64
NATIVE-IMPORTS-NEXT:   AddressSize: 64bit
NATIVE-IMPORTS-NEXT:   DelayImport {
NATIVE-IMPORTS-NEXT:     Name: test.dll
NATIVE-IMPORTS-NEXT:     Attributes: 0x1
NATIVE-IMPORTS-NEXT:     ModuleHandle: 0x5080
NATIVE-IMPORTS-NEXT:     ImportAddressTable: 0x5098
NATIVE-IMPORTS-NEXT:     ImportNameTable: 0x3380
NATIVE-IMPORTS-NEXT:     BoundDelayImportTable: 0x0
NATIVE-IMPORTS-NEXT:     UnloadDelayImportTable: 0x0
NATIVE-IMPORTS-NEXT:   }
NATIVE-IMPORTS-NEXT: }

RUN: llvm-readobj --hex-dump=.testa out-native.dll | FileCheck --check-prefix=NATIVE-TESTSECA %s
NATIVE-TESTSECA: 0x180007000 88500000 08100000

RUN: llvm-objdump -d out-native.dll | FileCheck --check-prefix=NATIVE-DISASM %s
NATIVE-DISASM:      0000000180001000 <.text>:
NATIVE-DISASM-NEXT: 180001000: 52800060     mov     w0, #0x3                // =3
NATIVE-DISASM-NEXT: 180001004: d65f03c0     ret
NATIVE-DISASM-NEXT: 180001008: 90000030     adrp    x16, 0x180005000
NATIVE-DISASM-NEXT: 18000100c: f9404610     ldr     x16, [x16, #0x88]
NATIVE-DISASM-NEXT: 180001010: d61f0200     br      x16
NATIVE-DISASM-NEXT: 180001014: 90000031     adrp    x17, 0x180005000
NATIVE-DISASM-NEXT: 180001018: 91022231     add     x17, x17, #0x88
NATIVE-DISASM-NEXT: 18000101c: 14000001     b       0x180001020 <.text+0x20>
NATIVE-DISASM-NEXT: 180001020: a9b37bfd     stp     x29, x30, [sp, #-0xd0]!
NATIVE-DISASM-NEXT: 180001024: 910003fd     mov     x29, sp
NATIVE-DISASM-NEXT: 180001028: a90107e0     stp     x0, x1, [sp, #0x10]
NATIVE-DISASM-NEXT: 18000102c: a9020fe2     stp     x2, x3, [sp, #0x20]
NATIVE-DISASM-NEXT: 180001030: a90317e4     stp     x4, x5, [sp, #0x30]
NATIVE-DISASM-NEXT: 180001034: a9041fe6     stp     x6, x7, [sp, #0x40]
NATIVE-DISASM-NEXT: 180001038: ad0287e0     stp     q0, q1, [sp, #0x50]
NATIVE-DISASM-NEXT: 18000103c: ad038fe2     stp     q2, q3, [sp, #0x70]
NATIVE-DISASM-NEXT: 180001040: ad0497e4     stp     q4, q5, [sp, #0x90]
NATIVE-DISASM-NEXT: 180001044: ad059fe6     stp     q6, q7, [sp, #0xb0]
NATIVE-DISASM-NEXT: 180001048: aa1103e1     mov     x1, x17
NATIVE-DISASM-NEXT: 18000104c: d0000000     adrp    x0, 0x180003000
NATIVE-DISASM-NEXT: 180001050: 910cc000     add     x0, x0, #0x330
NATIVE-DISASM-NEXT: 180001054: 97ffffeb     bl      0x180001000 <.text>
NATIVE-DISASM-NEXT: 180001058: aa0003f0     mov     x16, x0
NATIVE-DISASM-NEXT: 18000105c: ad459fe6     ldp     q6, q7, [sp, #0xb0]
NATIVE-DISASM-NEXT: 180001060: ad4497e4     ldp     q4, q5, [sp, #0x90]
NATIVE-DISASM-NEXT: 180001064: ad438fe2     ldp     q2, q3, [sp, #0x70]
NATIVE-DISASM-NEXT: 180001068: ad4287e0     ldp     q0, q1, [sp, #0x50]
NATIVE-DISASM-NEXT: 18000106c: a9441fe6     ldp     x6, x7, [sp, #0x40]
NATIVE-DISASM-NEXT: 180001070: a94317e4     ldp     x4, x5, [sp, #0x30]
NATIVE-DISASM-NEXT: 180001074: a9420fe2     ldp     x2, x3, [sp, #0x20]
NATIVE-DISASM-NEXT: 180001078: a94107e0     ldp     x0, x1, [sp, #0x10]
NATIVE-DISASM-NEXT: 18000107c: a8cd7bfd     ldp     x29, x30, [sp], #0xd0
NATIVE-DISASM-NEXT: 180001080: d61f0200     br      x16

RUN: llvm-readobj --coff-load-config out-native.dll | FileCheck --check-prefix=NATIVE-LOADCFG %s
NATIVE-LOADCFG:      AuxiliaryDelayloadIAT: 0x4000
NATIVE-LOADCFG-NEXT: AuxiliaryDelayloadIATCopy: 0x3140

RUN: llvm-readobj --hex-dump=.rdata out-native.dll | FileCheck --check-prefix=NATIVE-AUXIAT %s
NATIVE-AUXIAT:      0x180004000 00000000 00000000 00000000 00000000
NATIVE-AUXIAT-NEXT: 0x180004010 00000000 00000000


# Test delayed-load import from EC code only.

RUN: lld-link -machine:arm64x -dll -noentry -out:out-ec.dll loadconfig-arm64.obj loadconfig-arm64ec.obj \
RUN:          arm64-helper.obj arm64ec-helper.obj test-arm64ec.obj test-arm64.lib test-arm64ec.lib -delayload:test.dll

RUN: llvm-readobj --coff-imports out-ec.dll | FileCheck --check-prefix=EC-IMPORTS %s
EC-IMPORTS:      DelayImport {
EC-IMPORTS-NEXT:   Name: test.dll
EC-IMPORTS-NEXT:   Attributes: 0x1
EC-IMPORTS-NEXT:   ModuleHandle: 0x6080
EC-IMPORTS-NEXT:   ImportAddressTable: 0x6088
EC-IMPORTS-NEXT:   ImportNameTable: 0x4380
EC-IMPORTS-NEXT:   BoundDelayImportTable: 0x0
EC-IMPORTS-NEXT:   UnloadDelayImportTable: 0x0
EC-IMPORTS-NEXT: }
EC-IMPORTS-NEXT: HybridObject {
EC-IMPORTS-NEXT:   Format: COFF-ARM64EC
EC-IMPORTS-NEXT:   Arch: aarch64
EC-IMPORTS-NEXT:   AddressSize: 64bit
EC-IMPORTS-NEXT:   DelayImport {
EC-IMPORTS-NEXT:     Name: test.dll
EC-IMPORTS-NEXT:     Attributes: 0x1
EC-IMPORTS-NEXT:     ModuleHandle: 0x6080
EC-IMPORTS-NEXT:     ImportAddressTable: 0x6090
EC-IMPORTS-NEXT:     ImportNameTable: 0x4388
EC-IMPORTS-NEXT:     BoundDelayImportTable: 0x0
EC-IMPORTS-NEXT:     UnloadDelayImportTable: 0x0
EC-IMPORTS-NEXT:     Import {
EC-IMPORTS-NEXT:       Symbol: func (0)
EC-IMPORTS-NEXT:       Address: 0x180003006
EC-IMPORTS-NEXT:     }
EC-IMPORTS-NEXT:   }
EC-IMPORTS-NEXT: }

RUN: llvm-readobj --hex-dump=.test out-ec.dll | FileCheck --check-prefix=EC-TESTSEC %s
EC-TESTSEC: 0x180009000 08500000 90600000 00300000 10200000

RUN: llvm-objdump -d out-ec.dll | FileCheck --check-prefix=EC-DISASM %s
EC-DISASM:      0000000180001000 <.text>:
EC-DISASM-NEXT: 180001000: 52800060     mov     w0, #0x3                // =3
EC-DISASM-NEXT: 180001004: d65f03c0     ret
EC-DISASM-NEXT:                 ...
EC-DISASM-NEXT: 180002000: 52800040     mov     w0, #0x2                // =2
EC-DISASM-NEXT: 180002004: d65f03c0     ret
EC-DISASM-NEXT: 180002008: 52800060     mov     w0, #0x3                // =3
EC-DISASM-NEXT: 18000200c: d65f03c0     ret
EC-DISASM-NEXT: 180002010: f0000010     adrp    x16, 0x180005000
EC-DISASM-NEXT: 180002014: f9400610     ldr     x16, [x16, #0x8]
EC-DISASM-NEXT: 180002018: d61f0200     br      x16
EC-DISASM-NEXT: 18000201c: 9000002b     adrp    x11, 0x180006000
EC-DISASM-NEXT: 180002020: f940496b     ldr     x11, [x11, #0x90]
EC-DISASM-NEXT: 180002024: 9000000a     adrp    x10, 0x180002000 <.text+0x1000>
EC-DISASM-NEXT: 180002028: 9100c14a     add     x10, x10, #0x30
EC-DISASM-NEXT: 18000202c: 17fffff5     b       0x180002000 <.text+0x1000>
EC-DISASM-NEXT: 180002030: 52800080     mov     w0, #0x4                // =4
EC-DISASM-NEXT: 180002034: d65f03c0     ret
EC-DISASM-NEXT:                 ...
EC-DISASM-NEXT: 180003000: ff 25 8a 30 00 00            jmpq    *0x308a(%rip)           # 0x180006090
EC-DISASM-NEXT: 180003006: 48 8d 05 83 30 00 00         leaq    0x3083(%rip), %rax      # 0x180006090
EC-DISASM-NEXT: 18000300d: e9 00 00 00 00               jmp     0x180003012 <.text+0x2012>
EC-DISASM-NEXT: 180003012: 48 89 4c 24 08               movq    %rcx, 0x8(%rsp)
EC-DISASM-NEXT: 180003017: 48 89 54 24 10               movq    %rdx, 0x10(%rsp)
EC-DISASM-NEXT: 18000301c: 4c 89 44 24 18               movq    %r8, 0x18(%rsp)
EC-DISASM-NEXT: 180003021: 4c 89 4c 24 20               movq    %r9, 0x20(%rsp)
EC-DISASM-NEXT: 180003026: 48 83 ec 68                  subq    $0x68, %rsp
EC-DISASM-NEXT: 18000302a: 66 0f 7f 44 24 20            movdqa  %xmm0, 0x20(%rsp)
EC-DISASM-NEXT: 180003030: 66 0f 7f 4c 24 30            movdqa  %xmm1, 0x30(%rsp)
EC-DISASM-NEXT: 180003036: 66 0f 7f 54 24 40            movdqa  %xmm2, 0x40(%rsp)
EC-DISASM-NEXT: 18000303c: 66 0f 7f 5c 24 50            movdqa  %xmm3, 0x50(%rsp)
EC-DISASM-NEXT: 180003042: 48 8b d0                     movq    %rax, %rdx
EC-DISASM-NEXT: 180003045: 48 8d 0d f4 12 00 00         leaq    0x12f4(%rip), %rcx      # 0x180004340
EC-DISASM-NEXT: 18000304c: e8 b7 ef ff ff               callq   0x180002008 <.text+0x1008>
EC-DISASM-NEXT: 180003051: 66 0f 6f 44 24 20            movdqa  0x20(%rsp), %xmm0
EC-DISASM-NEXT: 180003057: 66 0f 6f 4c 24 30            movdqa  0x30(%rsp), %xmm1
EC-DISASM-NEXT: 18000305d: 66 0f 6f 54 24 40            movdqa  0x40(%rsp), %xmm2
EC-DISASM-NEXT: 180003063: 66 0f 6f 5c 24 50            movdqa  0x50(%rsp), %xmm3
EC-DISASM-NEXT: 180003069: 48 8b 4c 24 70               movq    0x70(%rsp), %rcx
EC-DISASM-NEXT: 18000306e: 48 8b 54 24 78               movq    0x78(%rsp), %rdx
EC-DISASM-NEXT: 180003073: 4c 8b 84 24 80 00 00 00      movq    0x80(%rsp), %r8
EC-DISASM-NEXT: 18000307b: 4c 8b 8c 24 88 00 00 00      movq    0x88(%rsp), %r9
EC-DISASM-NEXT: 180003083: 48 83 c4 68                  addq    $0x68, %rsp
EC-DISASM-NEXT: 180003087: ff e0                        jmpq    *%rax

RUN: llvm-readobj --coff-load-config out-ec.dll | FileCheck --check-prefix=EC-LOADCFG %s
EC-LOADCFG:      AuxiliaryDelayloadIAT: 0x5000
EC-LOADCFG-NEXT: AuxiliaryDelayloadIATCopy: 0x4140

RUN: llvm-readobj --hex-dump=.rdata out-ec.dll | FileCheck --check-prefix=EC-AUXIAT %s
EC-AUXIAT:      0x180005000 00000000 00000000 1c200080 01000000
EC-AUXIAT-NEXT: 0x180005010 00000000 00000000


#--- test-arm64ec.s
    .section .test, "rd"
    .rva __imp_func
    .rva __imp_aux_func
    .rva func
    .rva "#func"

#--- test-arm64.s
    .section .testa, "rd"
    .rva __imp_func
    .rva func

#--- arm64ec-helper.s
    .section .text,"xr",discard,__icall_helper_arm64ec
    .globl __icall_helper_arm64ec
    .p2align 2, 0x0
__icall_helper_arm64ec:
    mov w0, #2
    ret

    .section .text,"xr",discard,"#__delayLoadHelper2"
    .globl "#__delayLoadHelper2"
    .p2align 2, 0x0
"#__delayLoadHelper2":
    mov w0, #3
    ret

    .section .hybmp$x, "yi"
    .symidx __imp_func
    .symidx func_exit_thunk
    .word 4

    .section .wowthk$aa,"xr",discard,func_exit_thunk
    .globl func_exit_thunk
func_exit_thunk:
    mov w0, #4
    ret

#--- arm64-helper.s
    .section .text,"xr",discard,__delayLoadHelper2
    .globl __delayLoadHelper2
    .p2align 2, 0x0
__delayLoadHelper2:
    mov w0, #3
    ret

#--- test.def
NAME test.dll
EXPORTS
    func