Re: Making a direct function call from inline assembly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/12/2010 09:44 AM, Job Noorman wrote:
Hi,

I am trying to make a direct function call from inline assembly like this:

     asm("call %0" : : "i"(func));

This doesn't work because GCC will generate something like

     call $mangledFunc

which will give an assembly error.
Is there a way to do this?

Thanks in advance!
Job

PS: I know I can do something like

     asm("call *%0" : : "r"(func));

But then it's not a direct call anymore.

PPS: I also posted this question on StackOverflow:
http://stackoverflow.com/questions/3467180/direct-call-using-gccs-inline-
assembly
Are you simply trying to do:

    asm("call func");

That produces the assembly language (using -S option to gcc):
    call func

--Bob



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux