I need to access an argument from a C function
void printk(char* msg);
and store it into ESI. However I can not do
mov $msg, %esi
or
mov $_msg, %esi
Both return a linker error (Saying that the symbol msg or _msg is undefined. I am pretty sure I could access msg by reading from the stack but it would be easier just to access the symbol msg in my assembly code. Is this even possible in GCC?
You can’t refer to variables like that in GCC inline assembly. I think you want something like: