News for hackers. Stuff that matters.
Re:x86: Deprecate a.out support by ktjfi on Friday March 08, 2019 @10:16AM (#19338196)
Isn't a.out the default output format of gcc? I think if you type "gcc myfile.c" you get an a.out executable.
Re:x86: Deprecate a.out support by moray on Friday March 08, 2019 @10:21AM (#19338262)
Here it refers to the binary executable file format not the default file name gcc uses after compilation.

a.out is a very old format superseded by ELF.

https://en.wikipedia.org/wiki/A.out

Re:x86: Deprecate a.out support by FineTralfazz on Friday March 08, 2019 @10:17AM (#19338214)
It's named a.out, but that's just a legacy convention. It's still an ELF file.
Re:x86: Deprecate a.out support by tannhaeuser on Friday March 08, 2019 @10:19AM (#19338234)
No it's just the file name. If you run `file` on it, it'll tell you it's an ELF image.
Re:x86: Deprecate a.out support by classichasclass on Friday March 08, 2019 @10:18AM (#19338220)
No, you get a file named a.out by default, but it's not in that format.
Re:x86: Deprecate a.out support by torlakur on Friday March 08, 2019 @10:20AM (#19338235)
The name has stuck for some reason, but actually the output format is ELF.
Re:x86: Deprecate a.out support by benj111 on Friday March 08, 2019 @11:16AM (#19338870)
As others have pointed out it's an elf file called a.out.

I would like to ask who's idea it was to name GCCs default output after a completely different file format ?!

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

Re:x86: Deprecate a.out support by naniwaduni on Friday March 08, 2019 @11:43AM (#19339199)
The format was named for the file, not the file for the format. By the time this became incongruous, it was too late to fix.