|
|
By default, files produced by the link editor for a UNIX system always have a standard UNIX system a.out header in the optional header field. The UNIX system a.out header is 28 bytes. The fields of the optional header are described in ``Optional header contents''.
Optional header contents
Bytes | Declaration | Name | Description |
---|---|---|---|
0-1 | short | magic | Magic number |
2-3 | short | vstamp | Version stamp |
4-7 | long int | tsize | Size of text in bytes |
8-11 | long int | dsize | Size of initialized data in bytes |
12-15 | long int | bsize | Size of uninitialized data in bytes |
16-19 | long int | entry | Entry point |
20-23 | long int | text_start | Base address of text |
24-27 | long int | data_start | Base address of data |
Whereas the magic number in the file header specifies the machine on which the object file runs, the magic number in the optional header supplies information telling the operating system on that machine how that file should be executed. The magic numbers recognized by SCO operating systems are given in ``UNIX system magic numbers''.
UNIX system magic numbers
Value | Meaning |
---|---|
0407 | Text segment is not write-protected or sharable; data segment is contiguous with the text segment. |
0410 | Data segment starts at the next segment following the text segment and the text segment is write-protected. |
0413 | Text and data segments are aligned within a.out so it can be directly paged. |
0443 | Defines a.out to be a target shared library. |