This is the mail archive of the binutils@sources.redhat.com 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 of dlltool for enhanced dll-stub creation@rsl-sie.de


> -----Original Message-----
> From: binutils-owner On Behalf Of Mark Junker
> Sent: 17 May 2004 17:11

> Hi,
> 
> I created a patch for dlltool.c that allows all Win32-DLL 
> users to use a 
> DEF file with EXPORTS of the form
> 
>     external_name = internal_name
> 
> and the created archive contains an export with "external_name" but 
> it'll call the DLL function "internal_name".
> 
> We needed this because we had to use a 3rd party DLL that contains 
> __stdcall functions *without* the @n at the end of the names ...

  You have heard about the '--enable-stdcall-fixup' option to ld, right?  I
believe it does what you want:

-------------------snip-------------------
"`--enable-stdcall-fixup'
`--disable-stdcall-fixup'
     If the link finds a symbol that it cannot resolve, it will attempt
     to do "fuzzy linking" by looking for another defined symbol that
     differs only in the format of the symbol name (cdecl vs stdcall)
     and will resolve that symbol by linking to the match.  For
     example, the undefined symbol `_foo' might be linked to the
     function `_foo@12', or the undefined symbol `_bar@16' might be
     linked to the function `_bar'.  When the linker does this, it
     prints a warning, since it normally should have failed to link,
     but sometimes import libraries generated from third-party dlls may
     need this feature to be usable.  If you specify
     `--enable-stdcall-fixup', this feature is fully enabled and
     warnings are not printed.  If you specify
     `--disable-stdcall-fixup', this feature is disabled and such
     mismatches are considered to be errors."
-------------------snip-------------------


  However, your patch is more widely generalized than that, and might well
be of use in other circumstances.



   cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


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