call/jmp

From: tom (tom_at_dbsevice.com)
Date: 01/26/04


Date: Mon, 26 Jan 2004 12:50:04 +0100

I have a plugin architecture.
The loader loads a library (so), and gets a pointer
to a list of function pointers (an sort of an interface).
In the loader, there are many functions which doesn't
do anything other than just call the apropriate function
in the interface. An short example:

void foo(int arg) { interface->foo(arg); }
int bar(void *arg) { return interface->bar(arg); }

and so on...

I looked at the generated assemply, and I've seen
that the compiler generated a quite long code, first
some 'push' and then a 'call'. I thought this is not
necessary, so I replaced it by a 'jmp'.
But I got an SIGSEGV.

Is it possible to replace the 'call' by a 'jmp'?

thanks
tom



Relevant Pages

  • Re: call/jmp
    ... > I have a plugin architecture. ... > The loader loads a library, ... > to a list of function pointers (an sort of an interface). ...
    (comp.os.linux.development.system)
  • Re: call/jmp
    ... > The loader loads a library, ... > to a list of function pointers (an sort of an interface). ... > that the compiler generated a quite long code, ...
    (comp.os.linux.development.system)
  • Re: Adapting software to multiple usage patterns
    ... function qsort() has a function pointer parameter. ... is it about aggregating several function pointers that makes you ... think the response to a proposed interface with such a type ... by the functions that access the data structures, ...
    (comp.lang.c)
  • Re: IConverterSession - Which Header file has the lpVtable Definition.
    ... >> Anyone know which platform SDK header file the interface for this is ... > It's not defined anywhere other than MSDN, that documentation is new from ... > Even if you're doing it in C, can't you just put in blank entries in the ... > array of function pointers, rather than having undefined ones in the class ...
    (microsoft.public.win32.programmer.messaging)
  • Re: call/jmp
    ... >> The loader loads a library, ... >> to a list of function pointers. ... int a, int ) ... Not being fluent in Intex x86 assembly language, ...
    (comp.os.linux.development.system)