[PATCH v2] ld/PE: Handle MS style import libraries for files named *.exe too
Jan Beulich
jbeulich@suse.com
Fri Nov 8 11:46:22 GMT 2024
On 07.11.2024 13:31, Martin Storsjö wrote:
> When handling MS style import libraries (also called short import
> libraries, or ILF), we need to detect the kind of library.
>
> So far, this has been done by looking at the member file names
> in the import library - in an MS style import library, all the
> member files for a specific library have the same member file
> name - the name of the runtime module to link against. Usually
> this is a DLL - thus we do a case insensitive comparison and
> check if the suffix is .dll.
>
> However, an .exe can also export symbols which can be linked
> against in the same way. In particular, if linking against
> WDK (Windows Driver Kit) import libraries, e.g. wdmsec.lib, the
> import libraries can provide imports for ntoskrnl.exe.
>
> Thus extend the preexisting check from checking for the .dll
> suffix to also checking for .exe. While this isn't entirely
> complete and scalable (in theory, such libraries could have
> any suffix), this should cover a larger majority of them.
>
> This doesn't conflict with the regular long import libraries that
> GNU tools generate, where each member file has a name ending with
> .o.
> ---
> v2: Fixed the indentation to use tabs.
FTR - I thought it was better to continue the discussion on the v1
thread.
Jan
More information about the Binutils
mailing list