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

Jan Beulich jbeulich@suse.com
Tue Oct 1 06:37:59 GMT 2024


On 30.09.2024 23:00, Martin Storsjö wrote:
> 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.

The change looks plausible for what is described above, yet even if the
form is formally undocumented, some kind of reference must exist
somewhere. Such a reference is imo quite relevant to have here.

> --- a/include/coff/pe.h
> +++ b/include/coff/pe.h
> @@ -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

Please use tab padding here, just like the neighboring lines do.

Jan


More information about the Binutils mailing list