This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: New name mangling in g++
- To: Andreas Schwab <schwab at suse dot de>
- Subject: Re: New name mangling in g++
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 29 Jan 2001 17:51:55 +0100
- Cc: Oliver Kellogg <oliver dot kellogg at vs dot dasa dot de>, gcc at gcc dot gnu dot org
- References: <3A759F42.D3897D6E@vs.dasa.de> <jebssqxqro.fsf@hawking.suse.de>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jan 29, 2001 at 05:32:59PM +0100, Andreas Schwab wrote:
> Oliver Kellogg <oliver.kellogg@vs.dasa.de> writes:
>
> |> Hello IA-64 C++ ABI experts,
> |>
> |> I am trying to understand the name mangling scheme as
> |> implemented in recent experimental snapshots of G++.
> |>
> |> Given this code:
> |>
> |> typedef struct {
> |> int a;
> |> } stru;
> |>
> |> class M {
> |> public:
> |> // [...]
> |> void mixed (const stru &a, const stru b, stru &c, stru d,
> |> const stru &e, const stru f, stru &g, stru h);
> |> };
> |>
> |>
> |> the gcc-snapshot-20010126 mangles the method "mixed" as follows:
> |>
> |> _ZN1M5mixedERK4struS0_RS0_S0_S2_S0_S3_S0_
> |>
> |> My questions are:
> |> What does the mangler treat as S1?
> |> Where is the `const' qualifier of argument b coded?
>
> The `const' is not part of the interface.
const is part of the interface, it is encoded with the K.
I believe this is a bug in mangle.c because:
$ c++filt -s gnu-new-abi _ZN1M5mixedERK4struS0_RS0_S0_S2_S0_S3_S0_
M::mixed(const stru&, M::mixed, M::mixed&, M::mixed, const stru, M::mixed, const stru&, M::mixed)
I believe it should be mangled as
_ZN1M5mixedERK4struS2_RS1_S1_S3_S2_S4_S1_
, am just looking into mangle.c to see what's going on.
Jakub