This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [patch] Fix corruption of non-C++ symbols by the demangler
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 14 Jan 2014 11:22:41 +0100
- Subject: Re: [patch] Fix corruption of non-C++ symbols by the demangler
On Tue, 2014-01-14 at 10:07 +0100, Jan Kratochvil wrote:
> On Tue, 14 Jan 2014 10:00:59 +0100, Mark Wielaard wrote:
> > The __GLOBAL__.[ID]_xxx functions are wrappers generated when a module
> > xxx contains constructors and destructors of static objects, which will
> > call the actual static initialization and destruction functions for all
> > globals in the module. Since they are "normal" functions they could
> > potentially end up in a backtrace, but I am not sure "demangling" them
> > provides any real benefit.
>
> In such case I will add it, it should be there.
It probably doesn't hurt, but it also isn't a real/proper mangling
scheme. Just an g++ convention. It "demangles" to 'global constructors
keyed to xxx'. According to the documentation the only prefix you should
check for is _Z:
http://mentorembedded.github.io/cxx-abi/abi.html#demangler
If the user has a set of external names to demangle, they should
check that the names are in fact mangled (that is, begin with
"_Z") before passing them to __cxa_demangle.
Cheers,
Mark