01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A_OUT ( 4 } A-OUT (4)<br />

NAME<br />

a.out - common assembler and link editor output<br />

SYNOPSIS<br />

#include < a.out.h ><br />

DESCRIPTION<br />

The file name a.out is the output file from the assembler a.s(l)<br />

and the link editor ld(l). Both programs will make a. out executable<br />

if there were no errors in assembling or linking and no<br />

unresolved external references.<br />

A common object file consists of a file header, a UNIX system<br />

header, a table of section headers, relocation information,<br />

(optional) line numbers, a symbol table, and a string table. The<br />

order is given below.<br />

File header.<br />

UNIX header.<br />

Section 1 header.<br />

Section n header.<br />

Section 1 data.<br />

Section n data.<br />

Section 1 relocation.<br />

Section n relocation.<br />

Section 1 line numbers.<br />

Section n line numbers.<br />

Symbol table.<br />

String table.<br />

The last three parts (line numbers, symbol table and string table)<br />

may be missing if the program was linked with the -s option of<br />

ld(l) or if the symbol table and relocation bits were removed by<br />

strip(!). Also note that the relocation information will be absent<br />

if there were no unresolved external references after linking. The<br />

string table exists only if the symbol table contains symbols with<br />

names longer than eight characters.<br />

The sizes of each section (contained in the header, discussed<br />

below) are in bytes and are even.<br />

When an a.out file is loaded into memory for execution, three logical<br />

segments are set up: the text segment, the data segment (initialized<br />

data followed by uninitialized, the latter actually being<br />

initialized to all O's), and a stack. The text segment begins at<br />

location OxOOOO in the core image. The header is never loaded<br />

except for magic 0413 files created with the -F option of ld(l). If<br />

the magic number (the first field in the operating system header)<br />

is 407 (octal), it indicates that the text segment is not to be<br />

write-protected or shared, so the data segment will be contiguous<br />

with the text segment. If the magic number is 410 (octal), the<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!