This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils 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]

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


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