This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [Patch/pe-i386]: Revert and fix ld/deffilep.y patch for names with '.' separators
- From: Christopher Faylor <cgf at redhat dot com>
- To: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- Cc: binutils <binutils at sources dot redhat dot com>,Luke Dunstan <coder_infidel at hotmail dot com>
- Date: Thu, 13 Mar 2003 03:35:41 -0500
- Subject: Re: [Patch/pe-i386]: Revert and fix ld/deffilep.y patch for names with '.' separators
- References: <20030313083017.82135.qmail@web21406.mail.yahoo.com>
On Thu, Mar 13, 2003 at 07:30:17PM +1100, Danny Smith wrote:
>Hi the patch I checked in yesterday was wrong. Although it is okay for
>the most common uses of ld to create a dll, it fails when using an
>IMPORT section. The function def_import expects the dot-separated name
>to be parsed into module.module_ext.symbol_name not imput as a single ID
>
>Here is a testcase:
>================================
>;foo.def
>IMPORTS
>_alldiv at 16 = ntoskrnl.exe._alldiv
>;end foo.def
>=================================
>/* foo.c */
>extern __stdcall long long
>_alldiv (long long num, long long denom);
>
>long long
>lldiv(long long a, long long b)
> { return _alldiv (a,b);}
>/* foo.c */
>=================================
>A dll that exports lldiv, while using the _alldiv forwarded
>from ntoskrnl.exe (without an import lib) can be created by
>
>gcc -shared -ofoo.dll foo.def foo.c
>
>
>The following reverts yesterday's patch and adds new rule (dot_name) to handle
>dot-separated names. The rule is recursive to allow multiple dots in
>filenames (eg my.file.name,cc) which could be used by g++ in
>generation of unnamed namespace names.
>
>Thanks to Luke Dunstan for reporting the mistake and providing help with this.
>
>A patch to fix up a related problem in def_import will be submitted
>seaparately.
Ok to commit.
Thanks,
cgf