aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object
diff options
context:
space:
mode:
authorJacek Caban <jacek@codeweavers.com>2024-07-22 14:13:21 +0200
committerGitHub <noreply@github.com>2024-07-22 14:13:21 +0200
commitcffe1153f4466b1602d4778e57c3bd8663cef5ec (patch)
tree75fea444e14a17f74390313ef4555eb054f62e6b /llvm/lib/Object
parentf39bd0a24e8aaa55c957c179607c071a86590ec1 (diff)
downloadllvm-cffe1153f4466b1602d4778e57c3bd8663cef5ec.zip
llvm-cffe1153f4466b1602d4778e57c3bd8663cef5ec.tar.gz
llvm-cffe1153f4466b1602d4778e57c3bd8663cef5ec.tar.bz2
[llvm-dlltool] Use EXPORTAS name type for renamed imports on ARM64EC. (#99346)
Renamed entries are more tricky on ARM64EC than on other targets due to additional symbols (we need `__imp_aux_*` in addition to `__imp_*` and both mangled and unmangled symbol thunks). While we could extend weak aliases to add them, it seems cleaner to just always use EXPORTAS name type on ARM64EC targets. Unlike other targets, linkers supporting ARM64EC need to support EXPORTAS, so there is no compatibility problem with that.
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r--llvm/lib/Object/COFFImportFile.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Object/COFFImportFile.cpp b/llvm/lib/Object/COFFImportFile.cpp
index 2458a53..e67b024 100644
--- a/llvm/lib/Object/COFFImportFile.cpp
+++ b/llvm/lib/Object/COFFImportFile.cpp
@@ -729,7 +729,10 @@ Error writeImportLibrary(StringRef ImportName, StringRef Path,
else if (Machine == IMAGE_FILE_MACHINE_I386 &&
applyNameType(IMPORT_NAME_NOPREFIX, Name) == E.ImportName)
NameType = IMPORT_NAME_NOPREFIX;
- else if (Name == E.ImportName)
+ else if (isArm64EC(M)) {
+ NameType = IMPORT_NAME_EXPORTAS;
+ ExportName = E.ImportName;
+ } else if (Name == E.ImportName)
NameType = IMPORT_NAME;
else {
Deferred D;