PATCH mingw32 PE dlltool: Use internal name in import files.
Dave Korn
dk@artimi.com
Tue Jun 29 09:34:00 GMT 2004
> -----Original Message-----
> From: binutils-owner On Behalf Of Aaron W. LaFramboise
> Sent: 29 June 2004 06:18
> I don't think this is right. After checking, the MS tools do not seem
> to do this.
>
> Can someone explain to me what internal_name is supposed to mean? I
> can't find it documented anywhere what exactly its meaning is!
>
> EXPORTS
> name = internal_name
>
> What does internal_name represent? Does it even do anything?
> While it
> is carried from input .def to output .def, it does not appear
> to be put
> into either output import libraries or output .exp's.
According to MSDN, this construct allows you to create an exported
function 'name' that corresponds to an actual function 'internal_name' in
the .dll; that is, 'internal_name' is the real function in the code and
'name' is the externally-visible alias that callers link against, that you
can look up with GetProcAddress, etc, etc.
> I notice that Mumit Khan added an option --add-stdcall-alias
> to dlltool,
> but how can this possibly do anything if aliases do not seem
> to do anything?
Ah, that'll be something to do with the name decoration, won't it? It's
not normal for plain old C symbols to get mangled, but when you use the
stdcall calling convention, M$' tools decorate the name with '@nnn', where
nnn is the number of bytes of stack arguments the function takes. IIRC the
--add-stdcall-alias just means that for each symbol with the '@nnn' postfix,
you also get an equivalent undecorated symbol generated, to make linking
against callers that don't understand M$ stdcall name decoration that little
bit easier.
cheers,
DaveK
--
Can't think of a witty .sigline today....
More information about the Binutils
mailing list