man51 - 11/3/71 NAME SYNOPSIS DESCRIPTION a.out - assembler...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
11/3/71 A.OUT (V) NAME a.out -- assembler and link editor output SYNOPSIS DESCRIPTION a.out is the output file of the assembler as and the link editor ld. In both cases, a.out is executable provided there were no errors and no unresolved external references. This file has four sections: a header, the program text, a symbol table, and relocation bits. The last two may be empty if the program was loaded with the —s option of ld or if the symbols and relocation have been removed by strip. The header always contains 6 words: 1 a “br .+14” instruction (205(8)) 2 The size of the program text 3 The size of the symbol table 4 The size of the relocation bits area 5 The size of a data area 6 A zero word (unused at present) The sizes of the program, symbol table, and relocation area are in bytes but are always even. The branch instruction serves both to identify the file and to jump to the text entry point. The program text size includes the 6—word header. The data area is used when the file is executed; the exec system call sets the program break to the sum of the text size and this data size. The data area is generated by the assembler when the location counter "." lies beyond the last assembled data, for example when the program ends with one or more constructions of the form .=.+n ; it is preserved by the loader for the last program in a load. (Routines other than the last have the appropriate number of 0 words inserted, since there is no other provision for zero—suppression in an a.out file.) The symbol table consists of 6—word entries. The first four contain the ASCII name of the symbol, null—padded. (In fact, the assembler generates symbols of at most 7 bytes.) The next word is a flag indicating the type of symbol. The following values are possible: 00 undefined symbol 01 absolute symbol 02 register symbol 03 relocatable symbol 40 undefined global symbol 41 absolute global symbol
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
11/3/71 A.OUT (v) 43 relocatable global symbol An undefined global corresponds to a GMAP “symref" and an absolute or relocatable global to a "symdef" or absolute or relocatable value respectively. Values other than those given above may occur if the user has defined some of his own instructions. The last word of a symbol table entry contains the value of the symbol. Its contents are not specified if the symbol is undefined. If a.out contains no unresolved global references, header and text portions are exactly as they will appear in core when the file is executed. If the value of a word in the text portion involves a reference to an undefined global, the word is replaced by the offset in the symbol table of the appropriate symbol. (That is, possible offsets are 0, 12(10), 24(10), . ...) Such a word will have appropriate relocation bits. The relocation bits portion uses a variable—length
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/18/2010 for the course ARCH Arch 101 taught by Professor Edwardhoe during the Spring '10 term at 카이스트, 한국과학기술원.

Page1 / 14

man51 - 11/3/71 NAME SYNOPSIS DESCRIPTION a.out - assembler...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online