blob: 1f22ca491755719e863864ff5b85e4c6a76604f0 [file] [log] [blame]
Jacek Caban31a6dbe2024-10-28 17:44:231# REQUIRES: aarch64, x86
2RUN: split-file %s %t.dir && cd %t.dir
3
4RUN: llvm-lib -machine:arm64ec -out:libtest.a -def:test.def
5RUN: llvm-mc -triple=arm64ec-windows-gnu arm64ec.s -filetype=obj -o arm64ec.obj
6RUN: llvm-mc -triple=arm64ec-windows-gnu x86_64.s -filetype=obj -o x86_64.obj
7
8RUN: lld-link -machine:arm64ec -out:out.dll -dll -noentry x86_64.obj arm64ec.obj libtest.a -lldmingw
9
10RUN: llvm-readobj --coff-imports out.dll | FileCheck -check-prefix=IMPORTS %s
11RUN: llvm-objdump -s out.dll | FileCheck --check-prefix=CONTENTS %s
12
13IMPORTS: Import {
14IMPORTS-NEXT: Name: test.dll
15IMPORTS-NEXT: ImportLookupTableRVA: 0x40E0
16IMPORTS-NEXT: ImportAddressTableRVA: 0x3000
17IMPORTS-NEXT: Symbol: variable (0)
18IMPORTS-NEXT: }
19
20Runtime pseudo relocation list header at 0x401c, consisting of 0x0, 0x0, 0x1.
21The first runtime pseudo relocation is from an x86_64 object file, with import
Jacek Cabanf858ac72025-03-02 12:10:0122from 0x3000, applied at 0x7000 with a size of 64 bits. The second pseudo
Jacek Caban31a6dbe2024-10-28 17:44:2323relocation is from an ARM64EC object file, with import from 0x3000, applied
Jacek Cabanf858ac72025-03-02 12:10:0124at 0x7008 with a size of 64 bits.
Jacek Caban31a6dbe2024-10-28 17:44:2325
26CONTENTS: Contents of section .rdata:
27CONTENTS: 180004010 00200000 10200000 00200000 00000000
28CONTENTS: 180004020 00000000 01000000 00300000 00700000
29CONTENTS: 180004030 40000000 00300000 08700000 40000000
30
31CONTENTS: Contents of section .test:
32CONTENTS-NEXT: 180007000 00300080 01000000 00300080 01000000
33CONTENTS-NEXT: 180007010 1c400080 01000000 40400080 01000000
34
35#--- arm64ec.s
36 .text
37 .global "#_pei386_runtime_relocator"
38"#_pei386_runtime_relocator":
39 ret
40
41 .weak_anti_dep _pei386_runtime_relocator
42.set _pei386_runtime_relocator,"#_pei386_runtime_relocator"
43
44 .section .test,"dr"
45 .quad variable
46 .quad __RUNTIME_PSEUDO_RELOC_LIST__
47 .quad __RUNTIME_PSEUDO_RELOC_LIST_END__
48
49#--- x86_64.s
50 .section .test,"dr"
51 .quad variable
52
53#--- test.def
54LIBRARY test.dll
55EXPORTS
56 variable DATA