GCC -o file option

-o file

Place output in file file. This applies to whatever sort of output is being produced, whether it be an executable file, an object file, an assembler file or preprocessed C code.

If -o is not specified, the default is to put an executable file in a.out, the object file for source.suffix in source.o, its assembler file in source.s, a precompiled header file in source.suffix.gch, and all preprocessed C source on standard output.

Example :

gcc -shared hellomodule.o hello_wrap.o -o _hello.so

References :

https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html