Answer by Ross Ridge for PC relative CALL with GCC inline assembly
All near and direct call instructions use relative addressing. So you don't really need to anything: __asm__ volatile ("call %P0" : : "i" (print_fn) : "rax", "rcx", "rdx", "rsi", "rdi","r8", "r9",...
View ArticleAnswer by Daniel Kamil Kozar for PC relative CALL with GCC inline assembly
Actually, the link you've posted contains the answer. When you take a look at the list of variations of CALL, you'll notice that all CALL instructions that use indirect addressing automatically mean...
View ArticlePC relative CALL with GCC inline assembly
I wrote the following sample code. But it generates "near, absolute indirect, address given in r/m32" (as given at [1]) variant of the call instruction which fails with a segmentation fault since the...
View Article
More Pages to Explore .....