-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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 IMPORT_NAME_EXPORTAS import library names. (
#83211) This allows handling importlibs produced by llvm-dlltool in #78772. ARM64EC import libraries use it by default, but it's supported by MSVC link.exe on other platforms too. This also avoids assuming null-terminated input, like in #78769.
- Loading branch information
Showing
2 changed files
with
30 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
REQUIRES: x86 | ||
RUN: split-file %s %t.dir && cd %t.dir | ||
|
||
Link to an import library containing EXPORTAS and verify that we use proper name for the import. | ||
|
||
RUN: llvm-mc -filetype=obj -triple=x86_64-windows test.s -o test.obj | ||
RUN: llvm-lib -machine:amd64 -out:test.lib -def:test.def | ||
RUN: lld-link -out:out1.dll -dll -noentry test.obj test.lib | ||
RUN: llvm-readobj --coff-imports out1.dll | FileCheck --check-prefix=IMPORT %s | ||
IMPORT: Symbol: expfunc | ||
|
||
#--- test.s | ||
.section ".test", "rd" | ||
.rva __imp_func | ||
|
||
#--- test.def | ||
LIBRARY test.dll | ||
EXPORTS | ||
func EXPORTAS expfunc |