0
#include "stdio.h"
void fseek(void *, int, int);
main() {
FILE* f = fopen("myfile", "rb");
asm("push 2");
asm("push 0");
asm("push f");
asm("call fseek");
asm("add esp, 12");
}
GCC -masm =英特尔call.c无法调用FSEEK与内联汇编
call.c:(.text+0x2c): undefined reference to `f'
call.c:(.text+0x31): undefined reference to `fseek'
我一直在尝试使用AT/T语法,但得到了同样的结果。
这第二个'asm'是不对的,因为调用函数将痛殴至少调用者保存寄存器。 – gsg