g++ 3 name mangling
jeroen dobbelaere
jeroen.dobbelaere@acunia.com
Mon Mar 4 09:07:00 GMT 2002
Carlo Wood wrote:
> On Mon, Mar 04, 2002 at 10:46:39AM +0100, jeroen dobbelaere wrote:
>
>>is there an easy (and generic) way in gcc to provide an __asm__ statement
>>with the mangled name of a c++ method ?
>>
>
> Why don't you use a C function?
> Ie:
>
> void Foo::f(int i) { ... }
>
> extern "C" void stub_Foo_f(Foo* th, int i);
> inline void stub_Foo_f(Foo* th, int i) { th->f(i); }
>
> and then use stub_Foo_f in the __asm__.
>
>
Problem is that I don't have control over the calling side : the c++ interface is
fixed. The implementation has to do some very low level things.
I've found a 'rough' solution, by using assembler directives (.if, .else, .endif)
in order to select the correct mangled name.
(for those more interested, see <http://bugzilla.mozilla.org/show_bug.cgi?id=106864>)
Greetings,
--
Jeroen Dobbelaere
Embedded Software Engineer
ACUNIA Embedded Solutions
http://www.acunia.com
More information about the Gcc
mailing list