delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/09/19/05:21:32

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: localhost.localdomain: ronald set sender to blytkerchan AT users DOT sourceforge DOT net using -f
Date: Fri, 19 Sep 2003 11:51:41 +0200
From: Ronald Landheer-Cieslak <blytkerchan AT users DOT sourceforge DOT net>
To: cygwin AT cygwin DOT com
Subject: Re: objdump : inaccurate demangling for foo(char* const)
Message-ID: <20030919095141.GE21770@linux_rln.harvest>
References: <bkdtn1$597$2 AT sea DOT gmane DOT org> <bke0qt$8l6$1 AT sea DOT gmane DOT org>
Mime-Version: 1.0
In-Reply-To: <bke0qt$8l6$1@sea.gmane.org>
User-Agent: Mutt/1.4i
X-Disclaimer: I had nothing to do with it - I swear!
X-loop: linux_rln.harvest

AFAIK, const is a compiler directive - there is nothing in the assembler
that make a symbol const. You should see const more like a promise: "I
promise I won't change the value of this variable". That promise can be 
broken by a const-cast, and the assembler code doesn't know anything about
it (AFAIK, there is no const in assembler, but I might be mistaken there).

rlc

On Fri, Sep 19, 2003 at 07:31:12AM +0300, Alex Vinokur wrote:
> 
> "Alex Vinokur" <alexvn AT connect DOT to> wrote in message news:bkdtn1$597$2 AT sea DOT gmane DOT org...
> > ==========================================
> > 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
> > ==========================================
> >
> 
> Updated question about objdump.
> 
> Low-level and user-level symbol names of foo2(char* const) are foo2(char*)
> 
> --------- 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>:    // OK
> 
> 00000006 <__Z4foo2Pc>:    // char*, not char* const
> 
> 
> $ objdump -d t.o
> 
> t.o:     file format pe-i386
> 
> Disassembly of section .text:
> 
> 00000000 <foo1(char*)>:    // OK
> 
> 
> 00000006 <foo2(char*)>:    // Not char* const
> 
> --------------------------------------
> 
> So, is it inaccuracy or convention?
> 
> 
>    =====================================
>    Alex Vinokur
>      mailto:alexvn AT connect DOT to
>      http://mathforum.org/library/view/10978.html
>    =====================================
> 
> 
> 
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

-- 
You will have a long and boring life.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019