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
Hi Dave,
2009/11/13 Dave Korn <dave.korn.cygwin@googlemail.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!
Well, I will sent one for this scenario in a separate patch :)
>> + ? ? ?&& ((*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.)
Well, I thought about this, too. But the pe_undef_alias_cdecl_match is
searching for undefined symbol, but the pe_undef_cdecl_match searches
for defined ones.
>> @@ -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.
Ok, I will add.
>> 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
>
>
Cheers,
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination