You can use gcc -o and -S together

Can i use for example

gcc -o -S output.s abs.c

to create an assembly file named output.s? I can't seem to. When I try to do this, I received the following error message.

Undefined symbols for x86_64 architecture: "_main" referenced: implicit input / start for the main executable file ld: character (s) not found for x86_64 architecture clang: error: linker command failed with exit code 1 (use -v to see the call)

I do not intend to use the linker, just try checking the build code.

+6
source share
1 answer

-o should follow the name of the output file. So this will work:

 gcc -S abc.c -o output.s 
+8
source

Source: https://habr.com/ru/post/986304/


All Articles