This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch] Make cxxfilt demangle internal-linkage templates
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: binutils at sourceware dot org
- Cc: ppluzhnikov at google dot com, richardsmith at google dot com
- Date: Tue, 06 Aug 2013 14:07:34 -0700
- Subject: [patch] Make cxxfilt demangle internal-linkage templates
Greetings,
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?
Thanks,
Google ref: b/10137049
---
Paul Pluzhnikov
2013-08-06 Paul Pluzhnikov <ppluzhnikov@google.com>
* 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':
default:
dc = d_unqualified_name (di);
if (d_peek_char (di) == 'I')