AllExperts > Encyclopedia 
Search      
Find out about volunteering to AllExperts

A.out (file format): Encyclopedia BETA


Free Encyclopedia
 Index · Browse A-Z  · Questions and Answers ·
Encyclopedia

Browse A-Z
ABCDEFGHIJKLMNOPQRSTUVWXYZNum


License
Disclaimer

 
 
 
 
Free Online Courses
12 Weeks to Weight Loss
Take Charge of Stress
Learn How to Bake
Budgeting 101
Deeper Faith
DIY Fashion Makeover

       MORE E-COURSES
 
   

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z  Misc

A.out (file format)



a.out (assembler output) is a file format, used in older versions of Unix and Unix-like operating systems, for executables, object code, and, in later systems, shared libraries. It appeared in V6 UNIX and it was superseded by the COFF format in AT&T Unix System V, which was in turn superseded by ELF in System V Release 4.

Though Berkeley Unix kept using a.out 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. FreeBSD/i386 switched to ELF during the 2.2 to 3.0 transition.

Linux also used a.out until kernel 1.2 [1] (ELF support was added in the experimental 1.1.52), when it was superseded by ELF for that platform as well. 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 which the library was located at with a central authority, as the a.out ld.so in Linux was unable to relocate shared libraries. The various BSD flavours 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 Linux's [2].

a.out executables typically came in one of several variants, OMAGIC, NMAGIC, QMAGIC, or ZMAGIC. The OMAGIC format had contiguous segments after the header, with no separation of text and data. The NMAGIC format was similar to OMAGIC, however the data segment was loaded on the immediate next page after the end of the text segment, and the text segment was marked read-only. The ZMAGIC format added support for demand paging, and QMAGIC allowed the a.out header to be merged with the first page of the text segment, typically saving a page worth of memory. QMAGIC binaries were typically loaded one page above the bottom of the virtual address space, in order to permit trapping of null pointer dereferences via a segmentation fault.

a.out is still the default output name for executables created by the compiler or linker when no name is specified with the -o option.

An a.out file consists of up to 7 sections. In order, these sections are:

exec header:Contains parameters used by the kernel to load a binary file into memory and execute it, and by the link editor ld to combine a binary file with other binary files. This section is the only mandatory one.

text segment:Contains machine code and related data that are loaded into memory when a program executes. May be loaded read-only.

data segment:Contains initialized data; always loaded into writable memory.

text relocations:Contains records used by the link editor to update pointers in the text segment when combining binary files.

data relocations:Like the text relocation section, but for data segment pointers.

symbol table:Contains records used by the link editor to cross ref-erence the addresses of named variables and functions (`symbols') between binary files.

String table:Contains the character strings corresponding to the symbol names.



Email this page
About Us | Advertise on This Site | User Agreement | Privacy Policy | Kids' Privacy Policy | Help
About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.
This is the "GNU Free Documentation License" reference article from the English Wikipedia. All text is available under the terms of the GNU Free Documentation License. See also our Disclaimer.