PE-COFF and import tables

Dave Korn dave.korn.cygwin@googlemail.com
Sat May 9 18:16:00 GMT 2009


pps wrote:

> I also noticed that kind of weird stuff. I my case one of the dlls is
> listed like 10 times! :)
> It happens because one of the dll's exportes data member and the other
> dll auto imports it. That data member is referenced in 10 or so
> different files I believe. To fix that I appended
> __declspec(dllexport/dllimport) to the declaration of the exported
> symbol and in such case it's all ok.

  Yep, these are the auto-import entries I spoke of.  But note that's not
quite what's going on here; both these two import tables have multiple entries.

> Also I had references to coredll.dll and COREDLL at the same time. I
> personally don't like that COREDLL thing and to fix that I deleted
> libceoldname.a (which references COREDLL instead of coredll.dll) and for
> all unresolved references I manually added code forwarding functions like:
> wchar_t * wcsdup(const wchar_t *s){ return _wcsdup(s); }

  Ah, so perhaps something is malformed in libceoldname.a?  How is it built -
perhaps using dlltool to process the DEF file and generate the import lib?  If
so, that would suggest the bug I mentioned earlier.

    cheers,
      DaveK



More information about the Binutils mailing list