This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: objdump : inaccurate demangling for foo(char* const)
"Daniel Jacobowitz" <drow@mvista.com> wrote in message 20030919040314.GA13263@nevyn.them.org">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?
=====================================
Alex Vinokur
mailto:alexvn@connect.to
http://mathforum.org/library/view/10978.html
=====================================