I'm trying to compile the code referred to in the below link. I'm getting the below linker error:
/tmp/ccUVLIZ0.ltrans0.ltrans.o: In function `main':
:(.text.startup+0x5): undefined reference to `one'
collect2: error: ld returned 1 exit status
Equivalent for GCC's naked attribute
The linker is not seeing the assembly definition?
Code below:
#include <stdio.h>
asm("_one: \n\
movl $1,%eax \n\
ret \n\
");
int one();
int main() {
printf("result: %d\n", one());
return 0;
}