RFC: Lose use of $ and . in [cd]tor labels

Per Bothner per@bothner.com
Thu Mar 22 20:19:00 GMT 2001


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/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /