This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


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

Re: GCJ/C++ name mangling incompatibility w/ "$"


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 ]



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