How do I compile the asm generated by GCC?

前端 未结 7 2015
南方客
南方客 2020-12-04 06:18

I\'m playing around with some asm code, and something is bothering me.

I compile this:

#include 

int main(int argc, char** argv){
  p         


        
7条回答
  •  Happy的楠姐
    2020-12-04 07:08

    Yes, You can use gcc to compile your asm code. Use -c for compilation like this:

    gcc -c file.S -o file.o
    

    This will give object code file named file.o. To invoke linker perform following after above command:

    gcc file.o -o file
    

提交回复
热议问题