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:
> > I'm using gcc 2.95.2 under Linux. Just made a quick test: gcc does not
> > add *any* decorations to symbols declared as __attribute__((__stdcall__)).
>
> Linux is not Windows. It's a completely different ABI.
I didn't compare Linux vs. Windows, I did ask about the differences in the
*compiler* (gcc) behaviour on that platforms.
> Since Linux
> doesn't support stdcall, gcc on linux doesn't honor it.
Well, I believe that OS has nothing to do with calling conventions. It's
a job of compiler. And gcc on Linux *does* support stdcall, it just doesn't
add name decorations.
> Comparing
> Windows to Linux is as useless as comparing Windows to Solaris or any
> other operating system.
Sure. I won't start flame wars regarding it.
> > ld and dlltool have completely different .def file parsers.
>
> Yup, out of neccessity.
>
> > IMO dlltool does a much better job;
>
> Yup. It's much more mature. However, there are a few things ld can
> do that you can't do with dlltool, like linking directly against a DLL
> *without* an import library, and building a dll and import library in
> one step instead of five.
It works fine, until someone (me) will try to link with a dll such as
kernel32.dll. Why, you know better than me. Because of that, I'm forced
to use dlltool and dllwrap.
> > giving .def file to ld directly, I managed to get a not loadable
> > dll.
>
> That's a bug that needs to be reported and eventually fixed.
What sort of bug report do you need? Sample code?
> > Instead of having and maintaining both of them, ld should make use
> > of the common parser code. I'm sorry, I won't do it myself, it's
> > just a suggestion to the binutils developers; I'm very busy with my
> > current work.
>
> Understood. Ideally, ld should be enhanced to do everything dlltool
> does, and then dlltool can go away.
Yes. The same statement I have seen somewhere in the documentation.
--
Dmitry.