A.out

Last updated

a.out
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.

Contents

"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]

History

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]

Debugging

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

Related Research Articles

<span class="mw-page-title-main">Executable and Linkable Format</span> Standard file format for executables, object code, shared libraries, and core dumps.

In computing, the Executable and Linkable Format, is a common standard file format for executable files, object code, shared libraries, and core dumps. First published in the specification for the application binary interface (ABI) of the Unix operating system version named System V Release 4 (SVR4), and later in the Tool Interface Standard, it was quickly accepted among different vendors of Unix systems. In 1999, it was chosen as the standard binary file format for Unix and Unix-like systems on x86 processors by the 86open project.

In computing, a core dump, memory dump, crash dump, storage dump, system dump, or ABEND dump consists of the recorded state of the working memory of a computer program at a specific time, generally when the program has crashed or otherwise terminated abnormally. In practice, other key pieces of program state are usually dumped at the same time, including the processor registers, which may include the program counter and stack pointer, memory management information, and other processor and operating system flags and information. A snapshot dump is a memory dump requested by the computer operator or by the running program, after which the program is able to continue. Core dumps are often used to assist in diagnosing and debugging errors in computer programs.

<span class="mw-page-title-main">Netwide Assembler</span> Assembler for the Intel x86 architecture

The Netwide Assembler (NASM) is an assembler and disassembler for the Intel x86 architecture. It can be used to write 16-bit, 32-bit (IA-32) and 64-bit (x86-64) programs. It is considered one of the most popular assemblers for Linux and x86 chips.

<span class="mw-page-title-main">UNIX System V</span> Early commercial UNIX operating system

Unix System V is one of the first commercial versions of the Unix operating system. It was originally developed by AT&T and first released in 1983. Four major versions of System V were released, numbered 1, 2, 3, and 4. System V Release 4 (SVR4) was commercially the most successful version, being the result of an effort, marketed as Unix System Unification, which solicited the collaboration of the major Unix vendors. It was the source of several common commercial Unix features. System V is sometimes abbreviated to SysV.

<span class="mw-page-title-main">Pseudoterminal</span>

In some operating systems, including Unix-like systems, a pseudoterminal, pseudotty, or PTY is a pair of pseudo-device endpoints (files) which establish asynchronous, bidirectional communication (IPC) channel between two or more processes.

The GNU Assembler, commonly known as gas or as, is the assembler developed by the GNU Project. It is the default back-end of GCC. It is used to assemble the GNU operating system and the Linux kernel, and various other software. It is a part of the GNU Binutils package.

vmlinux Executable file containing the Linux kernel

vmlinux is a statically linked executable file that contains the Linux kernel in one of the object file formats supported by Linux, which includes Executable and Linkable Format (ELF) and Common Object File Format (COFF). The vmlinux file might be required for kernel debugging, symbol table generation or other operations, but must be made bootable before being used as an operating system kernel by adding a multiboot header, bootsector and setup routines.

file (command) Standard Unix program

The file command is a standard program of Unix and Unix-like operating systems for recognizing the type of data contained in a computer file.

<span class="mw-page-title-main">UPX</span>

UPX is a free and open source executable packer supporting a number of file formats from different operating systems.

The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory. Typically, it is mapped to a mount point named /proc at boot time. The proc file system acts as an interface to internal data structures about running processes in the kernel. In Linux, it can also be used to obtain information about the kernel and to change certain kernel parameters at runtime (sysctl).

<span class="mw-page-title-main">History of Unix</span>

The history of Unix dates back to the mid-1960s, when the Massachusetts Institute of Technology, AT&T Bell Labs, and General Electric were jointly developing an experimental time-sharing operating system called Multics for the GE-645 mainframe. Multics introduced many innovations, but also had many problems. Bell Labs, frustrated by the size and complexity of Multics but not its aims, slowly pulled out of the project. Their last researchers to leave Multics – among them Ken Thompson, Dennis Ritchie, Doug McIlroy, and Joe Ossanna – decided to redo the work, but on a much smaller scale.

In computing, a dynamic linker is the part of an operating system that loads and links the shared libraries needed by an executable when it is executed, by copying the content of libraries from persistent storage to RAM, filling jump tables and relocating pointers. The specific operating system and executable format determine how the dynamic linker functions and how it is implemented.

A kernel is a component of a computer operating system. A comparison of system kernels can provide insight into the design and architectural choices made by the developers of particular operating systems.

In computing, a shebang is the character sequence consisting of the characters number sign and exclamation mark at the beginning of a script. It is also called sharp-exclamation, sha-bang, hashbang, pound-bang, or hash-pling.

<span class="mw-page-title-main">Fiwix</span> Operating system

Fiwix is an operating system kernel based on the UNIX architecture and fully focused on being POSIX compatible. It is designed and developed mainly as a hobbyist operating system, but it also serves for educational purposes. It runs on the i386 hardware platform and is compatible with a good base of existing GNU applications. It follows the UNIX System V application binary interface and is also mostly Linux 2.0 system call ABI compatible.

<span class="mw-page-title-main">Linux kernel</span> Operating system kernel

The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally written in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU operating system, which was written to be a free (libre) replacement for Unix.

<span class="mw-page-title-main">Unix</span> Family of computer operating systems

Unix is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and others.

ptrace is a system call found in Unix and several Unix-like operating systems. By using ptrace one process can control another, enabling the controller to inspect and manipulate the internal state of its target. ptrace is used by debuggers and other code-analysis tools, mostly as aids to software development.

A virtual kernel architecture (vkernel) is an operating system virtualisation paradigm where kernel code can be compiled to run in the user space, for example, to ease debugging of various kernel-level components, in addition to general-purpose virtualisation and compartmentalisation of system resources. It is used by DragonFly BSD in its vkernel implementation since DragonFly 1.7, having been first revealed in September 2006, and first released in the stable branch with DragonFly 1.8 in January 2007. The long-term goal, in addition to easing kernel development, is to make it easier to support internet-connected computer clusters without compromising local security. Similar concepts exist in other operating systems as well; in Linux, a similar virtualisation concept is known as user-mode Linux; whereas in NetBSD since the summer of 2007, it has been the initial focus of the rump kernel infrastructure.

Capsicum is an implementation of capability-based security for UNIX and similar systems. Presented at USENIX 2010, the system is part of FreeBSD since its 9.0 release. It has also been adapted to DragonflyBSD in the form of kernel patches.

References

  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. Wood, Rupert (8 April 2002). "What to do with a.out". gcc-help (Mailing list). Retrieved 28 April 2007.
  3. "A way out for a.out [LWN.net]". lwn.net. Retrieved 12 September 2022.
  4. Ritchie, Dennis (3 November 1971). a.out – assembler and link editor output (PDF). Bell Labs . Retrieved 24 November 2006.
  5. "a.out page from Section 5 of the unix 8th manual". man.cat-v.org. Retrieved 12 October 2022.
  6. Lucas, Michael W. (2019). Absolute FreeBSD : the complete guide to FreeBSD (3rd ed.). San Francisco. p. 408. ISBN   9781593278922.{{cite book}}: CS1 maint: location missing publisher (link)
  7. Barlow, Daniel (14 July 1996). "The Linux ELF HOWTO (v1.29)". Archived from the original on 13 July 2004. Retrieved 28 March 2008.
  8. Drepper, Ulrich (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}}: Cite journal requires |journal= (help)
  9. Youngdale, Eric (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 (...)
  10. "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.
  11. "Linux Kernel Finally Deprecating A.out Support". Phoronix. Retrieved 1 September 2020.
  12. Petkov, Borislav (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.
  13. Corbet, Jonathan (22 May 2022). "The 5.18 kernel has been released". LWN. Retrieved 22 May 2022. the last vestiges of a.out support have been removed