This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Stdcall support in binutils
"DJ Delorie" <dj@delorie.com> wrote:
> cygwin does this. Put the decorated names in the def file.
>
> dlltool -k --output-lib foo.a --def foo.def
>
> ld -shared --kill-at foo.def *.o -o foo.dll
Great! Thank you.
Unfortunately ld does not understand forward statements in the def files,
it just crashes:
-- start of foo.def --
LIBRARY foo.dll
EXPORTS
foo_export1@4
foo_export2@4=bar.function@4
-- end of foo.def --
ld: foo.def:5: parse error
0 [main] ld 304 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
1201 [main] ld 304 stackdump: Dumping stack trace to ld.exe.stackdump
Using dllwrap helps to eliminate problem with forwards, but functions
in the export table have @ decorations again. I call dllwrap this way:
dllwrap --def foo.def -Wl,--kill-at $(ALL_OBJS) -o foo.dll
Specifying -Wl,--kill-at in the --driver-flags starts emit huge number of
error messages, which apparently mean that I need specify *ALL* defaults,
generally passed by dllwrap.
Certainly ld should be fixed to handle forwards in the .def files,
but I would be happy, if dllwrap could pass --kill-at directly to ld.
That would solve all my current troubles.
Again, thanks for your help.
--
Dmitry.