This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: question about gcc name mangling for gnu multiversion
- From: Ian Lance Taylor <iant at google dot com>
- To: Melanie B <mib dot bugzilla at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 14 Oct 2013 14:43:14 -0700
- Subject: Re: question about gcc name mangling for gnu multiversion
- Authentication-results: sourceware.org; auth=none
- References: <CAHjBzcEozG+8x8OB1Z8y6T3YHXgRFAzfzKd-gHuRLNPF+RYZzw at mail dot gmail dot com>
On Mon, Oct 14, 2013 at 2:13 PM, Melanie B <mib.bugzilla@gmail.com> wrote:
> The gcc name mangling for gnu multiversions includes a _Znum_ prefix
> e.g. the test case in the gcc testsuite named mv1.C
>
> .quad _Z13_Z3foov.ifuncv
> call _Z13_Z3foov.ifuncv
> .globl _Z13_Z3foov.ifuncv
> .type _Z13_Z3foov.ifuncv, @gnu_indirect_function
> .set _Z13_Z3foov.ifuncv,_Z3foov.resolver
> Is the _Z13 prefix needed? It seems like the .ifunc suffix would be adequate.
>
> grep ifunc *.s | grep call
> mv12.s: call _Z13_Z3foov.ifuncv
> mv12.s: call _Z13_Z3foov.ifuncv
> mv1.s: call _Z13_Z3foov.ifuncv
> mv2.s: call _Z13_Z3foov.ifuncv
> mv5.s: call _Z13_Z3foov.ifuncv
> mv6.s: call _Z19_ZN3Foo3fooEv.ifuncP3Foo
>
> Do you expect the name mangling will be added to a standards document?
I don't know the details of this work, but I do know that a _Z13
prefix followed by 13 arbitrary bytes will be demangled sensibly by
the existing C++ demangler.
Ian