[Patch/pe-i386]: ld/deffilep.y parsing of C++ mangled names with '.'

Christopher Faylor cgf@redhat.com
Wed Mar 12 01:16:00 GMT 2003


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@users.sourceforeg.net>
>
>	* deffilep.y (def_lec): Accept '.' as valid non-lead char..

Danny, go ahead and check this in.  It seems ok to me.

cgf



More information about the Binutils mailing list