{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

man51 - NAME SYNOPSIS DESCRIPTION a.out assembler and link...

Info icon This 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
Image of page 1

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

View Full Document Right 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 encoding. There is a string of bits for each word in the text portion. The scheme has at least two bits for. each word, plus possibly two more to extend the codes available; in either case the bits may be followed by a 16—bit string to represent an offset to an external symbol. The bits are
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern