This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCJ/C++ name mangling incompatibility w/ "$"
- To: bryce at albatross dot co dot nz (Bryce McKinlay)
- Subject: Re: GCJ/C++ name mangling incompatibility w/ "$"
- From: Joe Buck <jbuck at synopsys dot COM>
- Date: Mon, 12 Mar 2001 16:22:41 -0800 (PST)
- Cc: java at gcc dot gnu dot org, gcc at gcc dot gnu dot org
Bryce McKinlay wrote:
> The problem is that gcc/java/mangle_name.c is seeing
> NO_DOLLAR_IN_LABEL as defined. I think this comes from
> gcc/config/elfos.h. This is with the 3.0 branch on i686-pc-linux-gnu.
>
> The C++ name mangler is not honoring this definition, and is using "$"
> characters anyway. That doesn't seem to be a problem in itself, but it
> does break ABI compatibility between C++ and Java.
>
> So, who is right? Does C++ need to be fixed to use __U24_ instead of
> "$" in mangled names like GCJ does when NO_DOLLAR_IN_LABEL is defined, or
> does GCJ need to ignore NO_DOLLAR_IN_LABEL like C++ apparantly does?
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).