Add support for IMPORT_NAME_EXPORTAS in ILF (MSVC style) import libraries

This import name type is formally yet undocumented, but MSVC
produces/supports it, primarily for ARM64EC import libraries.

LLVM/LLD also supports this import name type. Since recently,
llvm-dlltool also uses this type for certain kinds of renamed imports
(that are easy to do in the long style import libraries produced by
GNU dlltool, but require this name type in short import libraries).

This name type contains a third string, in addition to the symbol
name and the DLL name, indicating the actual imported name to
reference in the import tables - which now can be distinct different
from the symbol name on the object file level.

8f23464a5d
and
7b275aa243
show how this import name type was added in LLVM.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö
2024-09-21 00:47:21 +03:00
parent 2754d75a11
commit 042f14505e
2 changed files with 37 additions and 7 deletions

View File

@@ -338,6 +338,7 @@ typedef struct
#define IMPORT_NAME 1
#define IMPORT_NAME_NOPREFIX 2
#define IMPORT_NAME_UNDECORATE 3
#define IMPORT_NAME_EXPORTAS 4
/* Weak external characteristics. */
#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1