This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
mingw import library compatibility question
- From: Doug Semler <dougsemler at gmail dot com>
- To: binutils at sourceware dot org
- Date: Tue, 9 Mar 2010 09:02:08 -0500
- Subject: mingw import library compatibility question
Are the DLL import libraries generated by the mingw toolchain
(specifically dlltool and ld) meant to be compatible with the native
MS LINK tools?
If they aren't, then that's no big deal (but it should be documented
somewhere :), except that it means another step to use the MS tool to
generate a link library based on a .def file during the build...
If they are then I've been having issues with linking with them unless
the native link command line includes /OPT:NOREF. Apparantly the MS
linker is throwing away the sections from the import libraries that
include the relocations (such as idata$2, $4, etc, which is a bad
thing, obviously).
In addition, if they *are* meant to be compatible, I noticed some
inconsistencies. Eg:. ld (not dlltool) doesn't mark the .text
sections of the function jump thunks (i.e. the _funcname jump to
__imp__funcname) as readonly, and i think that those functions should
be marked .linkonce so that they may be dropped during link if unused
by the compilation having used __declspec(dllimport). But before I
open a bug report I wanted to find out whether I should open one...if
the import libraries aren't meant to be compatible then the previous
statements are moot :)