This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [Patch/pe-i386]: ld/deffilep.y parsing of C++ mangled names with '.'
- 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>
- Date: Tue, 11 Mar 2003 20:16:14 -0500
- Subject: Re: [Patch/pe-i386]: ld/deffilep.y parsing of C++ mangled names with '.'
- References: <20030308085033.81082.qmail@web21402.mail.yahoo.com>
On Sat, Mar 08, 2003 at 07:50:33PM +1100, Danny Smith wrote:
> G++'s mangling of names in unnamed namespaces causes a segmentation fault in
>ld when
>building pe-i386 shared libraries (dlls).
>
>Compiling this with g++
>
>// Filename.cc
>namespace
>{
> int iii;
>};
>
>emits the symbol name __ZN28_GLOBAL__N_Filename.cc1bK1ib3iiiE
>
>I don't why anybody would want to explicitly export a name that is
>declared in an unnamed namespace, but g+ -shared does it by default, when
> --export-all is implied by lack of explicit dllimport attributes or def file.
>
>ld/deffilep.y does not handle the '.' in the name generated from the source
>filename and results in a call to strlen with an NULL argument while trying to
>report an invalid name.
>
>The simplest fix I could come up with is to just accept '.' as a valid
>non-lead char when parsing names:
>
>ld/Changelog
>
>2003-03-09 Danny Smith <dannysmith at users dot sourceforeg dot net>
>
> * deffilep.y (def_lec): Accept '.' as valid non-lead char..
Danny, go ahead and check this in. It seems ok to me.
cgf