objdump : inaccurate demangling for foo(char* const)

Daniel Jacobowitz drow@mvista.com
Fri Sep 19 04:31:00 GMT 2003


On Fri, Sep 19, 2003 at 07:22:01AM +0300, Alex Vinokur wrote:
> 
> "Daniel Jacobowitz" <drow@mvista.com> wrote in message news:20030919040314.GA13263@nevyn.them.org...
> > On Fri, Sep 19, 2003 at 06:37:38AM +0300, Alex Vinokur wrote:
> > > ==========================================
> > > Windows 2000 Professional
> > > CYGWIN_NT-5.0 1.5.4(0.94/3/2)
> > > GNU gcc version 3.2 20020927 (prerelease)
> > > GNU objdump 2.14.90 20030901
> > > ==========================================
> > >
> > >
> > > It seems that objdump inaccurately demangles foo(char* const).
> > >   Low-level symbol name of foo(char* const) is valid : __Z3fooPc
> > >   But user-level symbol name obtained after demangling is inaccurate : foo(char*).
> >
> > No, _Z3fooPc is the mangling for foo(char *).  It would be _Z3fooKPc.
> >
> > --
> > Daniel Jacobowitz
> > MontaVista Software                         Debian GNU/Linux Developer
> >
> 
> You are right :
> 
> --------- C++ code ---------
> void foo1 (char*) {}
> void foo2 (char* const) {}
> ----------------------------
> 
> 
> --------- objdump : Fragments ---------
> $ objdump -Cd t.o
> 
> t.o:     file format pe-i386
> 
> Disassembly of section .text:
> 
> 00000000 <__Z4foo1Pc>:
> 
> 00000006 <__Z4foo2Pc>:
> 
> 
> $ objdump -d t.o
> 
> t.o:     file format pe-i386
> 
> Disassembly of section .text:
> 
> 00000000 <foo1(char*)>:
> 
> 
> 00000006 <foo2(char*)>:
> 
> --------------------------------------
> 
> So, is it inaccuracy or convention?

Convention, I guess.  Ask on gcc@ perhaps.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



More information about the Binutils mailing list