|
| 1 | +# REQUIRES: aarch64, x86 |
| 2 | +RUN: split-file %s %t.dir && cd %t.dir |
| 3 | + |
| 4 | +RUN: llvm-lib -machine:arm64ec -out:libtest.a -def:test.def |
| 5 | +RUN: llvm-mc -triple=arm64ec-windows-gnu arm64ec.s -filetype=obj -o arm64ec.obj |
| 6 | +RUN: llvm-mc -triple=arm64ec-windows-gnu x86_64.s -filetype=obj -o x86_64.obj |
| 7 | + |
| 8 | +RUN: lld-link -machine:arm64ec -out:out.dll -dll -noentry x86_64.obj arm64ec.obj libtest.a -lldmingw |
| 9 | + |
| 10 | +RUN: llvm-readobj --coff-imports out.dll | FileCheck -check-prefix=IMPORTS %s |
| 11 | +RUN: llvm-objdump -s out.dll | FileCheck --check-prefix=CONTENTS %s |
| 12 | + |
| 13 | +IMPORTS: Import { |
| 14 | +IMPORTS-NEXT: Name: test.dll |
| 15 | +IMPORTS-NEXT: ImportLookupTableRVA: 0x40E0 |
| 16 | +IMPORTS-NEXT: ImportAddressTableRVA: 0x3000 |
| 17 | +IMPORTS-NEXT: Symbol: variable (0) |
| 18 | +IMPORTS-NEXT: } |
| 19 | + |
| 20 | +Runtime pseudo relocation list header at 0x401c, consisting of 0x0, 0x0, 0x1. |
| 21 | +The first runtime pseudo relocation is from an x86_64 object file, with import |
| 22 | +from 0x3000, applied at 0x7000 with a size of 32 bits. The second pseudo |
| 23 | +relocation is from an ARM64EC object file, with import from 0x3000, applied |
| 24 | +at 0x7008 with a size of 32 bits. |
| 25 | + |
| 26 | +CONTENTS: Contents of section .rdata: |
| 27 | +CONTENTS: 180004010 00200000 10200000 00200000 00000000 |
| 28 | +CONTENTS: 180004020 00000000 01000000 00300000 00700000 |
| 29 | +CONTENTS: 180004030 40000000 00300000 08700000 40000000 |
| 30 | + |
| 31 | +CONTENTS: Contents of section .test: |
| 32 | +CONTENTS-NEXT: 180007000 00300080 01000000 00300080 01000000 |
| 33 | +CONTENTS-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 |
| 54 | +LIBRARY test.dll |
| 55 | +EXPORTS |
| 56 | + variable DATA |
0 commit comments