1. default build
$gcc helloworld.c -o default.elf
$file default.elf
default.elf: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=fe1fe362cb4e81ba401e5904b56e981941117fe7, for GNU/Linux 3.2.0, not stripped
2. debug purpose
$gcc -g0 helloworld.c -o g0_hello.elf
$file g0_hello.elf
g0_hello.elf: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=fe1fe362cb4e81ba401e5904b56e981941117fe7, for GNU/Linux 3.2.0, not stripped
$gcc -g1 helloworld.c -o g1_hello.elf
$file g1_hello.elf
g1_hello.elf: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=8c1d21a2f78c63b06fc4636f6a8d0502292bda40, for GNU/Linux 3.2.0, with debug_info, not stripped
$gcc -g helloworld.c -o g_hello.elf
$file g_hello.elf
g_hello.elf: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=661921e05d61b8108316526de2cbe30551f5fec6, for GNU/Linux 3.2.0, with debug_info, not stripped
$gcc -g3 helloworld.c -o g3_hello.elf
$file g3_hello.elf
g3_hello.elf: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=4995b637d6284e89d19a699d40d6947ad5ffc6e6, for GNU/Linux 3.2.0, with debug_info, not stripped
3. strip purpose
$gcc -s helloworld.c -o s_hello.elf
s_hello.elf: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV),
$file s_hello.elf
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1d22b7327febb246050c6237d295e0d78d04f339, for GNU/Linux 3.2.0, stripped
$nm s_hello.elf
nm: s_hello.elf: no symbols
$gcc helloworld.c -o hello.elf
$file hello.elf
hello.elf: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=fe1fe362cb4e81ba401e5904b56e981941117fe7, for GNU/Linux 3.2.0, not stripped
$strip --strip-unneeded hello.elf
$file hello.elf
hello.elf: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=fe1fe362cb4e81ba401e5904b56e981941117fe7, for GNU/Linux 3.2.0, stripped
$strip --strip-all hello.elf
$file hello.elf
hello.elf: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=fe1fe362cb4e81ba401e5904b56e981941117fe7, for GNU/Linux 3.2.0, stripped
$nm hello.elf
nm: hello.elf: no symbols
4. efficiency purpose