public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Dave Korn" <dk@artimi.com>
To: "'Aaron W. LaFramboise'" <aaron98wiridge9@aaronwl.com>
Cc: <binutils@sources.redhat.com>, <me@cgf.cx>
Subject: RE: PATCH mingw32 PE dlltool: Use internal name in import files.
Date: Tue, 29 Jun 2004 09:34:00 -0000	[thread overview]
Message-ID: <NUTMEGCuc5bWsgHUgwH000005bf@NUTMEG.CAM.ARTIMI.COM> (raw)
In-Reply-To: <40E0FB7D.9030401@aaronwl.com>

> -----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....

      reply	other threads:[~2004-06-29  9:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-28 10:03 Aaron W. LaFramboise
2004-06-29  5:18 ` Aaron W. LaFramboise
2004-06-29  9:34   ` Dave Korn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=NUTMEGCuc5bWsgHUgwH000005bf@NUTMEG.CAM.ARTIMI.COM \
    --to=dk@artimi.com \
    --cc=aaron98wiridge9@aaronwl.com \
    --cc=binutils@sources.redhat.com \
    --cc=me@cgf.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).