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]: ld/deffilep.y parsing of C++ mangled names with '.'


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


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