stdcall, @s, and ld/dlltool...

Dmitry Timoshkov dmitry@baikal.ru
Tue Dec 25 05:51:00 GMT 2001


"Matthew Brett" <matthew.brett@mrc-cbu.cam.ac.uk> wrote:

> I am stuck with a linking problem, and think this may be to do with
> dlltool/dllwrap.

[skipped]

Some time ago I had a similar problem. With the help from cygwin and binutils
mailing lists, I've got the following:

I was using the following command lines to build DLLs:

dllwrap -o $(LIBRARY).dll $(OBJS) $(LIBS) -k --def $(LIBRARY).def -Wl,--kill-at,--enable-stdcall-fixup
dlltool --kill-at --input-def $(LIBRARY).def --output-lib lib$(LIBRARY).a

Then just link your object files with lib$(LIBRARY).a to produce an executable image.

Notes:
1. You have to have decorated (with @) exported names in the .def file.
2. Apply the attached patch to dlltool.c from the binutils and rebuild dlltool
(Warning: this patch was made against a rather old binutils source). Patch was
approved by DJ Delorie, but for some reason was never committed.

Please let me know whether this will help.
Good luck.

-- 
Dmitry.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dlltool.c.diff
Type: application/octet-stream
Size: 402 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20011225/0705145f/attachment.obj>


More information about the Binutils mailing list