Comment 36 for bug 1488254

Revision history for this message
In , Renato Golin (rengolin) wrote :

(In reply to comment #33)
> I really see no option in this; if the return type is tagged, the tag must be
> present in the signature somehow, or you can never mix different ABIs in the
> same binary.

This was probably already discussed, but if you mangle the return type, how can you mix this with previous mangling?

Say, you have:

int foo(int);

Old mangling would give you _Z3fooi. Then you add:

double foo(int);

With old mangling, you get an error. With new mangling (mixed with old mangling), you end up with three names. Say we mangle it before the function name:

_Z3fooi, _Z3ifooi, _Z3dfooi

Now, it's clear that _Z3fooi needs to be an alias to one of the other two, the question I can't answer is which one?

If you don't mix ABIs, then you only have two symbols and there is no problem.

And how different from this did GCC implement their mangling and why is it worse?