This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch]: fastcall/stdcall and import libraries in ld


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]