This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

[Bug c++/40831] New: g++ generated symbols for cloned function that be demangled.


G++ generates symbols for cloned functions that cannot be demangled, because of
".clone.N".

compiler version:

$ inst/bin/gcc -v
Using built-in specs.
Target: x86_64-linux
Configured with: ../trunk/configure --enable-languages=c,c++,fortran
--build=x86_64-linux --host=x86_64-linux --target=x86_64-linux
--prefix=/g/users/cgd/proj/gcc-trunk/bld/../inst
Thread model: posix
gcc version 4.5.0 20090722 (experimental) (GCC) 


I'll upload an example shortly.  For that example:

[cgd@bcpl gcc-trunk]$ inst/bin/gcc x.cc -c -O3
[cgd@bcpl gcc-trunk]$ ../binutils/inst.ld/bin/nm -an x.o
                 U _Z10externfuncv
                 U __gxx_personality_v0
0000000000000000 b .bss
0000000000000000 n .comment
0000000000000000 d .data
0000000000000000 r .eh_frame
0000000000000000 n .note.GNU-stack
0000000000000000 t .text
0000000000000000 t _Z12to_be_clonediPv.clone.0
0000000000000000 a x.cc
00000000000000c0 T _Z12to_be_clonediPv
0000000000000190 T _Z3fooPv
00000000000001b0 T _Z3barPv
[cgd@bcpl gcc-trunk]$ ../binutils/inst.ld/bin/nm -anC x.o
                 U externfunc()
                 U __gxx_personality_v0
0000000000000000 b .bss
0000000000000000 n .comment
0000000000000000 d .data
0000000000000000 r .eh_frame
0000000000000000 n .note.GNU-stack
0000000000000000 t .text
0000000000000000 t _Z12to_be_clonediPv.clone.0
0000000000000000 a x.cc
00000000000000c0 T to_be_cloned(int, void*)
0000000000000190 T foo(void*)
00000000000001b0 T bar(void*)

This may cause problems for tools (e.g., profilers, analysis tools), which
think they understand how to demangle symbols according to the ABI and want to
present demangled names to users.

Use of local-name might be appropriate here, I'm not sure.

(There may also be debugger implications of this.)


-- 
           Summary: g++ generated symbols for cloned function that be
                    demangled.
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cgd at google dot com
 GCC build triplet: x86_64-linux
  GCC host triplet: x86_64-linux
GCC target triplet: x86_64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831


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