This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld under cygwin and --enable-stdcall-fixup option
- From: "Aaron W. LaFramboise" <aaron98wiridge9 at aaronwl dot com>
- To: "Christian E. Boehme" <ceb at cb8 dot org>
- Cc: binutils at sourceware dot org
- Date: Fri, 27 May 2005 08:56:13 -0500
- Subject: Re: ld under cygwin and --enable-stdcall-fixup option
- References: <20050525003531.GA1192@aotearoa>
Christian E. Boehme wrote:
> The problem I ran into, however, is that the binutils linker, claiming
> to actually being able to resolve the missing __stdcall symbols by
> stripping off the '@xx' part of the exported name and looking
> again, apparently does not do so ;)
This is a hugely confusing area. The trouble here is that there are at
least three different symbol names: the name of the undefined reference,
the name of the definition provided by the import library, and the name
of the exported symbol in the actual image.
In a perfect world, all three of these symbols would match. In our not
so perfect world, vendors dream up very silly reasons to strip off the
stdcall decoration from stdcall symbols. Please complain loudly about
this. If a symbol is stdcall, it needs to have stdcall decoration, and
thats all there is to it.
Regarding your specific difficulty:
--enable-stdcall-fixup Link _sym to _sym@nn without warnings
I suspect that what you actually want would read the reverse: "Link
_sym@nn to _sym without warnings."
The way to fix this is to create your own import library with dlltool
-A. Contrary to what you mentioned, you do not need object symbols to
create an import library. (Like ELF, in PECOFF dynamic symbols are
separate from normal debugging symbols.) To create an import library,
extract the list of exports from the object using objdump, use this list
to create a DEF file. Feed this DEF file to dlltool -A.
Aaron W. LaFramboise