This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


"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.

Attachment: dlltool.c.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]