Filename extension |
none, .o, .so, .out |
---|---|
Magic number | 0407 , 0410 , 0413 (in octal) ; 0107 , 0108 , 010B (in hexadecimal) |
Developed by | AT&T |
Type of format | Binary, executable, object, shared libraries |
a.out is a file format used in older versions of Unix-like computer operating systems for executables, object code, and, in later systems, shared libraries. This is an abbreviated form of " assembler output", the filename of the output of Ken Thompson's PDP-7 assembler. [1] The term was subsequently applied to the format of the resulting file to contrast with other formats for object code.
"a.out" remains the default output file name for executables created by certain compilers and linkers when no output name is specified, even though the created files actually are not in the a.out format. [2]
Support for the a.out format was removed in Linux kernel version 5.18. [3]
An a.out format for the PDP-7, similar to the a.out format used on the PDP-11, appeared in the first edition of UNIX. [4] It was superseded by the COFF format in AT&T Unix System V, which was in turn superseded by the ELF format in System V Release 4. a.out files are identified by the magic numbers with octal codes 0407, 0410 or 0413. [5]
Though Berkeley Unix continued using the a.out format for some time, modern BSD systems have since switched to ELF. NetBSD/i386 switched formally from a.out to ELF in its 1.5 release (Dec. 2000). FreeBSD/i386 switched to ELF as a standard format during the 2.2 to 3.0 transition in 1998, however support for a.out remained in the system. [6]
MINIX 3 switched to ELF in the 3.2.0 release (Feb. 2012).
Linux also used a.out only until kernel 1.2 (Mar. 1995), when it was superseded by ELF for that platform as well. [7] ELF support was added in the experimental 1.1.52 kernel. Linux's transition to ELF was more or less forced due to the complex nature of building a.out shared libraries on that platform, which included the need to register the virtual address space at which the library was located with a central authority, as the a.out ld.so in Linux was unable to relocate shared libraries. [8] The various BSD flavors were able to continue using a.out binaries long after Linux was forced to switch to ELF, due to the somewhat more flexible nature of the BSD a.out format compared to that of Linux. [9] [10] The a.out file format on Linux was deprecated with the release of the 5.1 Linux kernel and the last parts of source code handling it were removed in 5.18. [11] [12] [13]
The a.out support for debug information is done through the use of special entries in the symbol table called stabs. The stabs format has also been used in many COFF and ELF variations.
{{
cite book}}
: CS1 maint: location missing publisher (
link)
When introducing shared libraries certain design decisions had to be made to work in the limitations of a.out. (...) For all these reasons and more, Linux converted early on to using ELF (Executable Linkage Format) as the binary format.
{{
cite journal}}
: Cite journal requires |journal=
(
help)
(...) it is not impossible to design shared library implementations that work with a.out. The current Linux shared libraries are certainly one example; another example is SunOS-style shared libraries which are currently used by BSD-du-jour. SunOS-style shared libraries contain a lot of the same concepts as ELF shared libraries (...)
There were no pressing reasons to switch earlier. In particular, FreeBSD did not (and does not) have the problems building shared libraries that spurred the Linux conversion from a.out to ELF.
Linux supports ELF binaries for ~25 years now. a.out coredumping has bitrotten quite significantly and would need some fixing to get it into shape again but considering how even the toolchains cannot create a.out executables in its default configuration, let's deprecate a.out support and remove it a couple of releases later, instead.
the last vestiges of a.out support have been removed