GCJ/C++ name mangling incompatibility w/ "$"
Bryce McKinlay
bryce@albatross.co.nz
Mon Mar 12 16:54:00 GMT 2001
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 ]
More information about the Java
mailing list