Before, it was enough to do
int main(int argc,char **argv){
char f[]="cadena"
asm("mov %0,%%rdi\n\t"
"call puts\n\t"
::""r"(f):"rdi")
}
and it worked, but not now. I tried to load the symbol
__GLOBAL_OFFEST_TABLE_
(even from %rip
) add and subtract offsets
from the libraries and call puts@PLT
. But it only works if I do
int main(int argc,char **argv){
char f[]="cadena"
asm("mov %0,%%rdi\n\t"
"callq puts@PLT\n\t"
::"r"(f):"rdi")
puts(cadena); //es decir cuando fuerzo la carga de la biblioteca
//en C
}
Any solutions?