PE-COFF and import tables

Pedro Alves pedro@codesourcery.com
Sun May 10 18:54:00 GMT 2009


On Sunday 10 May 2009 17:09:53, Vincent R. wrote:
> Personnaly I made my choice and I know which version is better.
> But maybe there is something wrong in the way of exporting variables, or
> maybe
> there is good reason to do like that.

It looks like PE Explorer screenshots, but I'm not sure.
It seems like what would happen if you are auto-importing
those variables in the "gnu" case.  This would
happen if you missed adding __declspec(dllimport) somewhere
where you're referencing those variables.
Each auto-import reference to a variable contributes one
of those "extra" import descriptors.  See the top of
ld/pe-dll.c for gory details.

Didn't the linker warn about auto-importing?  Something like:

 Info: resolving foo by linking to __imp_foo (auto-import)

... or is it the case were we don't warn anymore?  Try
linking with --disable-auto-import (-Wl,--disable-auto-import
if linking with gcc instead of ld).

-- 
Pedro Alves



More information about the Binutils mailing list