This is the mail archive of the mailing list for the binutils 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]

[patch] Make cxxfilt demangle internal-linkage templates


The following source:

  template<typename T> static void f();
  void g() { f<int>(); }

results in "_Z1fIiEvv" under g++, but in "_ZL1fIiEvv" under clang.

Richard Smith says:

  The ABI doesn't cover manglings for local symbols ...
  ... and c++filt is not able to cope with the L prefix here.

  I'm having a hard time seeing how this isn't a g++ bug and a matching
  c++filt bug.

It's hard for me to argue that this is a 'g++' bug (since there is no
ABI violation here), but c++filt should be able to handle this, and does
with attached patch.

Ok to commit?


Google ref: b/10137049
Paul Pluzhnikov

2013-08-06  Paul Pluzhnikov  <>

	* cp-demangle.c (d_name): Handle internal-linkage templates.

Index: libiberty/cp-demangle.c
RCS file: /cvs/src/src/libiberty/cp-demangle.c,v
retrieving revision 1.111
diff -p -u -r1.111 cp-demangle.c
--- libiberty/cp-demangle.c	4 Apr 2013 01:02:59 -0000	1.111
+++ libiberty/cp-demangle.c	6 Aug 2013 20:55:49 -0000
@@ -1276,7 +1276,6 @@ d_name (struct d_info *di)
     case 'Z':
       return d_local_name (di);
-    case 'L':
     case 'U':
       return d_unqualified_name (di);
@@ -1323,6 +1322,7 @@ d_name (struct d_info *di)
 	return dc;
+    case 'L':
       dc = d_unqualified_name (di);
       if (d_peek_char (di) == 'I')

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