This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] minsyms.c: Fix switching to GNU v3 ABI
Corinna Vinschen <vinschen@redhat.com> writes:
> > Consider this source code:
> >
> > void __verbose_terminate_handler()
> > {
> > static int terminating = 0;
> > if (terminating)
> > {
> > return;
> > }
> > terminating = 1;
> > }
> >
> > If you compile it as a C file, do you see the initial underscore on
> > "terminating". If you compile it as a C++ file, do you see two
> > initial underscores before the 'Z'? It should be consistent.
>
> It seems to be consistent:
>
> $ nm x.c.o
> 00000000 T ___verbose_terminate_handler
> 00000000 b terminating.0
>
> $ nm x.cc.o
> 00000000 b _ZZ27__verbose_terminate_handlervE11terminating
> 00000000 T __Z27__verbose_terminate_handlerv
Unfortunately, it seems to be consistently wrong.
I think this is a gcc bug. The symbol prefix should be applied
consistently to symbols whether they are globally or locally visible.
I don't see just where it is happening, though.
Ian