forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LLD][COFF] Add support for ARM64EC import call thunks with extended …
…range (llvm#109703) The MSVC linker generates range extensions for these thunks when needed. This commit inlines the range extension into the thunk, making it both slightly more optimal and easier to implement in LLD.
- Loading branch information
Showing
4 changed files
with
91 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
REQUIRES: aarch64, x86 | ||
RUN: split-file %s %t.dir && cd %t.dir | ||
|
||
RUN: llvm-mc -filetype=obj -triple=arm64ec-windows test.s -o test.obj | ||
RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o loadconfig-arm64ec.obj | ||
RUN: llvm-lib -machine:arm64ec -def:test.def -out:test.lib | ||
|
||
RUN: lld-link -machine:arm64ec -dll -noentry -out:out.dll loadconfig-arm64ec.obj test.obj test.lib | ||
|
||
RUN: llvm-objdump -d out.dll | FileCheck --check-prefix=DISASM %s | ||
DISASM: 0000000180001000 <.text>: | ||
DISASM-NEXT: 180001000: 52800000 mov w0, #0x0 // =0 | ||
DISASM-NEXT: 180001004: d65f03c0 ret | ||
DISASM-NEXT: ... | ||
DISASM-NEXT: 188001008: b000000b adrp x11, 0x188002000 | ||
DISASM-NEXT: 18800100c: f940016b ldr x11, [x11] | ||
DISASM-NEXT: 188001010: f0fbffea adrp x10, 0x180000000 | ||
DISASM-NEXT: 188001014: 9100014a add x10, x10, #0x0 | ||
DISASM-NEXT: 188001018: 90fc0010 adrp x16, 0x180001000 <.text> | ||
DISASM-NEXT: 18800101c: 91000210 add x16, x16, #0x0 | ||
DISASM-NEXT: 188001020: d61f0200 br x16 | ||
|
||
#--- test.s | ||
.text | ||
.globl __icall_helper_arm64ec | ||
.p2align 2, 0x0 | ||
__icall_helper_arm64ec: | ||
mov w0, #0 | ||
ret | ||
|
||
.space 0x8000000 | ||
|
||
.data | ||
.rva __imp_func | ||
|
||
#--- test.def | ||
NAME test.dll | ||
EXPORTS | ||
func |