This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to fix PR9861

Hash: SHA1

Ian Lance Taylor wrote:
> Ian Lance Taylor <> writes:
>>TJ Laurenzo <> writes:
>>>The attached patch corrects PR9861 by including the return type in
>>>mangled names in the C++ and Java compilers for Java class methods. 
>>>This changes the ABI for Java types but does not make any changes to
>>>C++ programs that do not access Java types.
>>How is the demangler going to work with this patch?  Is there any way
>>for the demangler to determine which names are Java names and which
>>are C++ names?  I don't see any obvious way, though I haven't looked
>>that hard.
> By the way, considering the demangler is not an unimportant point as
> any ambiguity in demangling is an ambiguity that can be happen when
> linking C++ and Java code together.  For example, your proposed
> mangling for
>     java.lang.Math.acos(double)
> appears to be
>     _ZN4java4lang4Math4acosEdd
> which is the mangled name which will be used for the C++ function
>     java::lang::Math::acos(double, double)

If we are changing the mangling for "Java" classes, is it possible
to have a mangling where the return type comes *before* the
class-cum-method name to disambiguate a (say) "void foo::bar(int,int)"
from an "int foo::bar(int)" when the return type is included?

Right now, without this patch, these seem to be encoded as
"ZN3foo3barEii" and "ZN3foo3barEi" respectively.


- --
Ranjit Mathew       Email: rmathew AT gmail DOT com

Bangalore, INDIA.     Web:

Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -


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