This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: GCJ/C++ name mangling incompatibility w/ "$"
- To: Joe Buck <jbuck at synopsys dot COM>
- Subject: Re: GCJ/C++ name mangling incompatibility w/ "$"
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Tue, 13 Mar 2001 14:04:12 +1300
- CC: java at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- References: <200103130022.QAA18150@toledo.synopsys.com>
Joe Buck wrote:
> It seems to me that it's a bug if we ever generate a '$' in a label if
> NO_DOLLAR_IN_LABEL is defined, since on some platforms where it is defined
> the assembler will barf if it sees a '$' (even though this is not true
> on i686-pc-linux-gnu).
>
> But this strikes me as odd, because I know that in at least some places
> the C++ name mangling checks NO_DOLLAR_IN_LABEL (e.g. for virtual
> function table symbols).
C++ seems to take care not to generate any "$" symbols on its own account
during virtual function mangling etc, but if there is are already "$"
characters in the source code then it does nothing to remove/mangle them. With
either C or C++ the following code will put $ symbols in the assembler output
on i686 linux:
void dollars$in$symbol() {}
$ cc -c dollar.cc
$ nm ./dollar.o | grep "\\$"
00000000 T dollars$in$symbol__Fv
$ c++ -c dollar.cc
$ nm ./dollar.o | grep "\\$"
00000000 T _Z17dollars$in$symbolv
regards
[ bryce ]