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

后端 未结 3 693
萌比男神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条回答
  •  梦毁少年i
    2021-01-16 13:56

    As user unwind mentioned:

    This is because your C program is expecting to be linked with the standard C runtime library, which has puts() in it. You can of course dig up the library file on your system as disassemble it, if you feel like it.

    So I used objdump to disassemble libc.a and found the assembly code under the section: objdump -d /usr/lib/x86_64-linux-gnu/libc.a

提交回复
热议问题