This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Lose use of $ and . in [cd]tor labels
- To: Jason Merrill <jason at redhat dot com>
- Subject: Re: RFC: Lose use of $ and . in [cd]tor labels
- From: Per Bothner <per at bothner dot com>
- Date: 22 Mar 2001 20:31:43 -0800
- Cc: Bryce McKinlay <bryce at albatross dot co dot nz>, gcc-patches at gcc dot gnu dot org, java at gcc dot gnu dot org
- References: <3AB8174F.AC842AA7@albatross.co.nz><u9n1ad67v1.fsf@casey.cambridge.redhat.com>
Jason Merrill <jason@redhat.com> writes:
> Would it be appropriate to change the Java frontend to stop using '$' in
> names that get mangled?
Well, '$' can appears in the Java source, though it is recommended that
user code not use '$'. However, .class files can be for classes whose
name (including file names) can contain with '$'. So it is not enough
for jc1 to not "use" '$' - any incoming '$' also need to be mangled
somehow.
I think we should handle this similarly as other non-ascii names. On
systems that can handle UTF8 in labels, we should also use '$'. On
other systems, we should mangle both. The no-dollar-in-label crock
should be revisited while we're considering how to handle non-ascii.
I think that on "GNU systems" (including those where
GNU binutils are the default):
(1) We should allow arbitrary UTF8 in binary files, including '$'.
(2) We should define an assembler quoting convention so that
any chararacter can be treated as an identifier character.
I.e. I would allow "99.9%" as an identifier in binary files.
In assembler files this could be written (using a Lisp convention):
\9\9\.\9\%:
The assembler could assume that any byte that has the high-bit set
should be treated as a "letter" for the purpose of parsing labels
- i.e. it is implicitly preceded by '\\'.
For non-GNU systmem, we need to define a mangling that handles
'$' and non-ascii.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/