Re:x86: Deprecate a.out support
by Arnt on Friday March 08, 2019 @11:45AM
(#19339231)
gcc copied most of its command-line arguments from older compilers, including -o, and the default value if -o isn't set was also copied.
So the command-line arguments and defaults are older than the ELF format. When ELF support was added, the question was: Should the default value for -o depend on other arguments? There didn't seem to be good reason to have a complicated default, and keeping the simple default provided compatibility with old scripts and makefiles.
cd tests ; for a in *.c ; do gcc $a && ./a.out ; done
So the command-line arguments and defaults are older than the ELF format. When ELF support was added, the question was: Should the default value for -o depend on other arguments? There didn't seem to be good reason to have a complicated default, and keeping the simple default provided compatibility with old scripts and makefiles.
cd tests ; for a in *.c ; do gcc $a && ./a.out ; done