a.out(4) — File Formats
Digital
NAME
a.out − assembler and link editor output
SYNOPSIS
#include <a.out.h>
DESCRIPTION
a.out is the output file format of the assembler as(1) and the link editor ld(1). Both programs make a.out executable if there were no errors and no unresolved external references. The debugger uses the a.out file to provide symbolic information to the user.
The compilers and operating systems use a file format that is similar to standard AT&T System V COFF (common object file format).
The File Header definition is based on the AT&T System V header file filehdr.h with the following changes (also see filehdr(4)):
•The symbol table file pointer, f_symptr, and the number of symbol table entries, f_nsyms, now specify the file pointer and the size of the Symbolic Header respectively.
•All tables that specify symbolic information have their file pointers and number of entries in the Symbolic Header.
The Optional Header definition has the same format as the AT&T System V header file aouthdr.h (the “standard” (pre-COFF) UNIX system a.out header) except the following fields have been added: bss_start, gprmask, cprmask, and gp_value.
The Section Header definition has the same format as the AT&T System V header file scnhdr.h, except the line number fields (s_lnnoptr and s_nlnno) are used for gp tables (see scnhdr(4)).
The relocation information definition is similar to that in Berkeley 4.3 UNIX, which has “local” relocation types (see reloc(4)).
The file format follows this scheme:
•File Header
•Optional Header
•Section Headers
•Section Data—includes text, read-only data, large data, 8 and 4 byte literal pools, small data, small bss (0 size), and large bss (0 size). As well as the shared library information.
•Section Relocation Information—includes information for text, read-only data, large data, 8 and 4 byte literal pools, and small data.
•Gp tables—missing if relocation information is not saved.
•Symbolic Header—missing if fully stripped.
•Line Numbers—created only if debugging is on, and missing if stripped of non-globals or fully stripped.
•Procedure Descriptor Table—missing if fully stripped.
•Local Symbols—missing if stripped of non-globals or if fully stripped.
•Optimization Symbols—created only if debugging is on, and missing if stripped of nonglobals or fully stripped.
•Auxiliary Symbols—created only if debugging is on, and missing if stripped of nonglobals or fully stripped.
•Local Strings—missing if stripped of non-globals or if fully stripped.
•External Strings—missing if fully stripped.
•Relative File Descriptors—missing if stripped of non-globals or if fully stripped.
•File Descriptors—missing if stripped of non-globals or if fully stripped.
•External Symbols—missing is fully stripped.
RELATED INFORMATION
linenum(4), filehdr(4), reloc(4), scnhdr(4), syms(4).
as(1), dbx(1), ld(1), nm(1), strip(1)