I need to generate a simple \"Hello World\" ELF32 executable using gcc. I don\'t seem to have the gcc-elf command though. Is it possible to create ELF binaries instead of a.
a.out is very old, we're talking kernel version 1.2 of linux. Assuming you are operating on any remotely recent linux platform, you are generating elf executables by default. Use the file
command on the output executable to verify. E.g.:
$ file server
server: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
Check the file a.out
$ file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
I believe the default name is retained as a.out but the format is ELF.