This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: dlltool -N [PATCH]
- From: Shaun Jackman <sjackman at gmail dot com>
- To: "Aaron W. LaFramboise" <aaron98wiridge9 at aaronwl dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 20 Sep 2004 23:13:19 -0700
- Subject: Re: dlltool -N [PATCH]
- References: <7f45d93904092018106a9247ef@mail.gmail.com> <414F823C.1050801@aaronwl.com>
- Reply-to: Shaun Jackman <sjackman at gmail dot com>
I'm using dlltool to create static library wrappers around
pre-existing DLLs (such as coredll.dll and winsock.dll). The dllimport
names, such as malloc, do not have an initial underscore. gcc, otoh,
expects malloc() to be called _malloc. So, -N adds an underscore to
the external symbol, but not the dllimport name.
I'm not familiar with --ext-prefix-alias. I didn't see any reference
to it in dlltool(1). Is it a switch to another program?
Please cc me in your reply. Cheers!
Shaun
On Mon, 20 Sep 2004 20:22:04 -0500, Aaron W. LaFramboise
<aaron98wiridge9@aaronwl.com> wrote:
> Shaun Jackman wrote:
>
> > This patch adds a switch to dlltool that prefixes global symbols of
> > the static interface library with underscores, but not the import
> > name. It's used to create stub static interface libraries for
> > pre-existing DLLs that do not use underscore prefixes. I'm not sure if
> > anyone else uses this functionality, but the patch is non-invasive.
>
> Can you explain this patch in more detail?
>
> In particular, I have three questions:
>
> 1) Why is the extra underscore needed? Dlltool already adds an implicit
> leading underscore in the generated import library symbol name.
>
> 2) Why is the extra underscore not added to the dllimport __imp_ names
> as well? (I'm not talking about the name placed in the IAT.)
>
> 3) Is this related to --ext-prefix-alias?
>
> Aaron W. LaFramboise
>
>