This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch]: fastcall/stdcall and import libraries in ld
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 13 Nov 2009 12:17:09 +0000
- Subject: Re: [patch]: fastcall/stdcall and import libraries in ld
- References: <90baa01f0911130210u6e532108yb1f082f7c4374fc@mail.gmail.com>
Kai Tietz wrote:
> This patch makes the described in documentation true, that stdcall
> functions can be fixuped. It additional implements that fastcall
> functions can be fixuped, too. Also it enables that functions from
> import libraries, which have no decoration, can match to
> fastcall/stdcall functions, when --enable-stdcall-fixup is specified
> without warnings.
Looks pretty good, but could really use some testcases, nag nag!
> + && ((*hs == '@' && *string == '_'
> + && strncmp (hs + 1, string + 1, sl - 1) == 0)
> + || strncmp (hs, string, sl) == 0)
Mixed spaces/TABs at the start of that third line there. Same in both the
emulation scripts and the pe-dll.c file. (BTW, why not factor this out?
pe_undef_cdecl_match and pe_undef_alias_cdecl_match are almost identical
except for the global variable they return the found symbol in, the code to do
the test is a bit hairy, it would sit well as an inline function or macro if
you could find some sensible header to put it in.)
> @@ -1212,6 +1220,9 @@
>
> pe_find_data_imports ();
>
> + if (pe_enable_stdcall_fixup) /* -1=warn or 1=disable */
> + pe_fixup_stdcalls ();
> +
I think you should add a comment here explaining the rationale for having a
second pass over the stdcall fixups here.
> Tested for i686-pc-mingw32, x86_64-pc-mingw32, and i686-pc-cygwin. Ok for apply?
Builds and tests good here too. OK by me after those minor tweaks, thank you.
cheers,
DaveK