public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40831]  New: g++ generated symbols for cloned function that be demangled.
@ 2009-07-22 23:28 cgd at google dot com
  2009-07-22 23:29 ` [Bug c++/40831] " cgd at google dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: cgd at google dot com @ 2009-07-22 23:28 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 18+ messages in thread
[parent not found: <bug-40831-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2011-10-19  0:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-22 23:28 [Bug c++/40831] New: g++ generated symbols for cloned function that be demangled cgd at google dot com
2009-07-22 23:29 ` [Bug c++/40831] " cgd at google dot com
2009-07-22 23:36 ` pinskia at gcc dot gnu dot org
2009-07-22 23:37 ` pinskia at gcc dot gnu dot org
2009-07-22 23:45 ` cgd at google dot com
     [not found] <bug-40831-4@http.gcc.gnu.org/bugzilla/>
2011-01-05  1:07 ` d.g.gorbachev at gmail dot com
2011-01-06 14:45 ` hubicka at gcc dot gnu.org
2011-02-23  7:08 ` ccoutant at gcc dot gnu.org
2011-02-23  9:04 ` d.g.gorbachev at gmail dot com
2011-02-23 18:46 ` ccoutant at gcc dot gnu.org
2011-02-23 19:46 ` hubicka at ucw dot cz
2011-08-20  3:35 ` ccoutant at gcc dot gnu.org
2011-09-23 21:47 ` ccoutant at gcc dot gnu.org
2011-09-24 12:35 ` d.g.gorbachev at gmail dot com
2011-09-26 18:32 ` ccoutant at gcc dot gnu.org
2011-09-26 20:06 ` ccoutant at gcc dot gnu.org
2011-10-19  0:02 ` pinskia at gcc dot gnu.org
2011-10-19  0:04 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).