I\'ve been playing around with the assembly output switch for GCC:
gcc -S -c helloworld.c
helloworld.c:
#i
answer:
use the gcc flags -fno-builtin
.
Explaination:
To improve the performance, GCC, Glibc will together make some modification to the standard C library. Because GCC and Glibc works together for almost all the userspace applications, so the builtin function is turned on default, which will convert printf()
function call with only one parameter with puts()
function call.
You can also tell GCC not to convert a specific builtin function call by using flags like -fno-builtin-printf
. Here is the complete list of the builtin functions which you can stop GCC to convert.
here is the detail explanation of the flag.