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/pe-i386]: Revert and fix ld/deffilep.y patch for names with '.' separators


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


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