Where do I find the assembly code for a procedure called in the GCC assembly output?

后端 未结 3 716
萌比男神i
萌比男神i 2021-01-16 13:32

I\'ve been playing around with the assembly output switch for GCC:

gcc -S -c helloworld.c

helloworld.c:

#i         


        
3条回答
  •  自闭症患者
    2021-01-16 13:56

    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.

提交回复
热议问题