The compiler (i.e. gccor g++) will call the linker ( ld), which creates the ELF executable.
In practice, you will use a build program (for example make) to manage commands gcc. See this answer .
The default output file for gccis still called a.out(for historical reasons), but is an ELF file. And you really want to ask gccfor an executable file with a more bizarre name.
A simple example: you are a hello-world.cprogram hello-world.c. You can compile it, for example, with
gcc -Wall -g hello-world.c -o hello-world-bin
(the order of the arguments gccis of great importance!)
and created hello-world-binis an ELF executable . Check with
file hello-world-bin
then run it with
./hello-world-bin your arguments to it
Later you will learn how to use the debugger on it gdb.
.