Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22040

Calling a static function from global inline assembly

$
0
0

I'm trying to define a function without any prologues/epilogues, a "landing address" so it can call an inner function which is properly managed by the compiler (useful for a caller-cleanup environment).

I found I can create a global label using inline assembly but I am having trouble calling another function within the same file. When I compile the code as is listed here I'm getting a warning:

WARNING: "handle_vmexit" [/Code/hyper/kernel/hyper.ko] undefined!

When I remove the static modifier, there are no issues.

So my question is, why is the inline assembly unable to link with handle_vmexit when it's static and how can I make it call a static handle_vmexit.

Here's the relevant code:

static void handle_vmexit(void){
    ...
}

__asm__(".handle_vmexit: \n\t""call handle_vmexit"
);

Viewing all articles
Browse latest Browse all 22040

Trending Articles