www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/03/05:17:38

Date: Wed, 3 May 2000 11:48:03 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp AT delorie DOT com
Subject: Re: Assembly and C++
In-Reply-To: <c7ptgsg5l0dsdudemt62n9k46g9a7hvg84@4ax.com>
Message-ID: <Pine.SUN.3.91.1000503114717.4851F-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 2 May 2000, Damian Yerrick wrote:

> >> How can I make class member functions with NASM or GAS ?
> >
> >I think it is much easier to use inline assembly, or to call a
> >function declared extern "C" from a C++ wrapper.
> 
> But you lose all of C++'s cool OOP features.

Not with inline assembly, you won't.

Anyway, that's why I think the first question should be: do I really
need to do it in assembly?

> >Otherwise, you will probably need to understand how does the
> >compiler mangle the names of C++ identifiers
> 
> Is this in any documentation?

I don't know, but you have cxxfilt that can demangle, and you have
sources to see how does it do that.

> >and the code you write could be broken by any new version of 
> >the compiler.
> 
> Shouldn't the mangling method be part of the object file format spec,
> like the initial underline is in COFF?

No, binutils only see the mangled names, which are simply symbols as
far as they are concerned.

But by ``could be broken'' I didn't mean the mangling (which will
probably not change much, if at all), but the wrapping code, such as
what was posted by the original poster: the frame info and the rest of
the stuff required for exceptions support.  This tends to change with
every compiler release (that's why mixing different versions doesn't
work with C++ programs).

C++ is a monstrously large and complex language, and it shows...

- Raw text -


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