xref: /llvm-project/lld/test/COFF/arm64ec-reloc.test (revision 47401b6173459515014a1bafe9a02c0e726fbec0)
1REQUIRES: aarch64, x86
2RUN: split-file %s %t.dir && cd %t.dir
3
4Link a mix of ARM64EC and x86_64 data and check that relocations work.
5
6RUN: llvm-mc -filetype=obj -triple=arm64ec-windows arm64ec-data-sym.s -o arm64ec-data-sym.obj
7RUN: llvm-mc -filetype=obj -triple=x86_64-windows x86_64-data-sym.s -o x86_64-data-sym.obj
8RUN: lld-link -out:test.dll -machine:arm64ec arm64ec-data-sym.obj x86_64-data-sym.obj -dll -noentry
9
10RUN: llvm-readobj --hex-dump=.data test.dll | FileCheck -check-prefix=ARM64EC-DATA %s
11ARM64EC-DATA: 0x180001000 00100080 01000000 08100080 01000000
12
13RUN: llvm-readobj --coff-basereloc test.dll | FileCheck -check-prefix=RELOCS %s
14RELOCS:      BaseReloc [
15RELOCS-NEXT:   Entry {
16RELOCS-NEXT:     Type: DIR64
17RELOCS-NEXT:     Address: 0x1000
18RELOCS-NEXT:   }
19RELOCS-NEXT:   Entry {
20RELOCS-NEXT:     Type: DIR64
21RELOCS-NEXT:     Address: 0x1008
22RELOCS-NEXT:   }
23RELOCS-NEXT: ]
24
25#--- arm64ec-data-sym.s
26        .data
27        .globl arm64ec_data_sym
28        .p2align 2, 0x0
29arm64ec_data_sym:
30        .xword arm64ec_data_sym
31
32#--- x86_64-data-sym.s
33        .data
34        .globl x86_64_data_sym
35        .p2align 2, 0x0
36x86_64_data_sym:
37        .quad x86_64_data_sym
38