a.out

From Wikipedia, the free encyclopedia
  (Redirected from A.out (file format))
Jump to navigation Jump to search

a.out
Filename extensionnone, .o, .so
Developed byAT&T
Type of formatBinary, 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]

History[edit]

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.[3] 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.

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 during the 2.2 to 3.0 transition (Oct 1998).

MINIX 3 switched to ELF in the 3.2.0 release.

Linux also used a.out until kernel 1.2 (March 1995), when it was superseded by ELF for that platform as well.[4] (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.[5] 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.[6][7] The final deprecation of the a.out file format on Linux will take place with the release 5.1 of the Linux Kernel.[8]

Use[edit]

Linking[edit]

Debugging[edit]

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.

See also[edit]

References[edit]

  1. ^ Ritchie (1993): "Thompson's PDP-7 assembler outdid even DEC's in simplicity; it evaluated expressions and emitted the corresponding bits. There were no libraries, no loader or link editor: the entire source of a program was presented to the assembler, and the output file—with a fixed name—that emerged was directly executable. (This name, a.out, explains a bit of Unix etymology; it is the output of the assembler. Even after the system gained a linker and a means of specifying another name explicitly, it was retained as the default executable result of a compilation.)"
  2. ^ Rupert Wood (8 April 2002). "What to do with a.out". gcc-help (Mailing list). Retrieved 28 April 2007.
  3. ^ Dennis Ritchie (3 November 1971). a.out — assembler and link editor output (PDF). Bell Labs. Retrieved 24 November 2006.
  4. ^ Daniel Barlow (14 July 1996). "The Linux ELF HOWTO (v1.29)". Archived from the original on 13 July 2004. Retrieved 28 March 2008.
  5. ^ Ulrich Drepper (20 August 2006). "How To Write Shared Libraries" (PDF). 4.0. Section 1.1 (A Little Bit of History). Archived (PDF) from the original on 16 June 2007. Retrieved 20 June 2007. 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 requires |journal= (help)
  6. ^ Eric Youngdale (1 April 1995). "The ELF Object File Format: Introduction". Archived from the original on 10 March 2009. Retrieved 6 May 2012. (...) 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 (...)
  7. ^ "BSD Myths". Archived from the original on 17 April 2007. Retrieved 10 April 2007. 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.
  8. ^ Borislav Petkov (5 March 2019). "x86: Deprecate a.out support". Retrieved 5 March 2019. 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.

External links[edit]