Mail Archives: djgpp/2000/05/03/05:17:38
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 -