📄 a.out.5
字号:
.th A.OUT V 9/9/73.sh NAMEa.out \*- assembler and link editor output.sh DESCRIPTION.it A.outis the output file of the assembler.it asand the link editor.it ld.Both programs make.it a.outexecutable if there were noerrors and no unresolved external references..s3This file has four sections:a header, the program and data text, a symbol table, and relocation bits(in that order).The last two may be emptyif the program was loadedwith the ``\*-s'' optionof.it ldor if the symbols and relocation have beenremoved by.it strip..s3The header always contains 8 words:.s3.lp +5 31 A magic number (407, 410, or 411(8)).lp +5 32 The size of the program text segment.lp +5 33 The size of the initialized portion of the data segment.lp +5 34 The size of the uninitialized (bss) portion of the data segment.lp +5 35 The size of the symbol table.lp +5 36 The entry location (always 0 at present).lp +5 37 Unused.lp +5 38 A flag indicating relocation bits have been suppressed.s3.i0The sizes of each segment are in bytes but are even.The size of the header is not included in any of the other sizes..s3When a file produced by the assembler or loader isloaded into core for execution, three logical segments areset up: the text segment, the data segment(with uninitialized data, which starts off as all 0, followinginitialized),and a stack.The text segment begins at 0in the core image; the header is not loaded.If the magic number (word 0) is 407, it indicates that the textsegment is not to be write-protected and shared,so the data segment is immediately contiguouswith the text segment.If the magic number is 410,the data segment begins at the first 0 mod 8K byteboundary following the text segment,and the text segment is not writable by the program;if other processes are executing the same file,they will share the text segment.If the magic number is 411,the text segment is again pure, write-protected, and shared,and moreover instruction and data space are separated;the text and data segment both begin at location 0.See the 11/45 handbook for restrictions which apply to thissituation..s3The stack will occupy the highest possible locationsin the core image: from 177776(8) and growing downwards.The stack is automatically extended as required.The data segment is only extended as requested bythe.it breaksystem call..s3The start of the text segment in the file is 20(8);the start of the data segment is 20+S\s6\dt\u\s10 (the size of the text)the start of the relocation information is20+S\s6\dt\u\s10+S\s6\dd\u\s10;the start of the symbol table is20+2(S\s6\dt\u\s10+S\s6\dd\u\s10)if therelocation information is present,20+S\s6\dt\u\s10+S\s6\dd\u\s10if not..s3The symbol table consists of 6-word entries. The firstfour words contain the ASCII name of the symbol, null-padded.The next word is a flag indicating the type of symbol.The following values are possible:.s3.lp +6 300 undefined symbol.lp +6 301 absolute symbol.lp +6 302 text segment symbol.lp +6 303 data segment symbol.lp +6 337 file name symbol (produced by ld).lp +6 304 bss segment symbol.lp +6 340 undefined external (.globl) symbol.lp +6 341 absolute external symbol.lp +6 342 text segment external symbol.lp +6 343 data segment external symbol.lp +6 344 bss segment external symbol.i0.s3Values other than those given above mayoccur if the user has defined some of his own instructions..s3The last word of a symbol table entry contains the value of the symbol..s3If the symbol's type is undefined external,and the value field is non-zero,the symbol is interpreted by the loader.it ldasthe name of a common regionwhose size is indicated by the value of thesymbol..s3The value of a word in the text or data portions which is nota reference to an undefined external symbolis exactly that value which will appear in corewhen the file is executed.If a word in the text or data portioninvolves a reference to an undefined external symbol,as indicated by the relocation bitsfor that word,then the value of the word as stored in the fileis an offset from the associated external symbol.When the file is processed by thelink editor and the external symbol becomesdefined, the value of the symbol willbe added into the word in the file..s3If relocationinformation is present, it amounts to one word perword of program text or initialized data.There is no relocation information if the ``suppress relocation''flag in the header is on..s3Bits 3-1 of a relocation word indicate the segment referredto by the text or data word associated with the relocationword:.s3.lp +6 300 indicates the reference is absolute.lp +6 302 indicates the reference is to the text segment.lp +6 304 indicates the reference is to initialized data.lp +6 306 indicates the reference is to bss (uninitialized data).lp +6 310 indicates the reference is to an undefined external symbol..i0.s3Bit 0 of the relocation word indicates if.it onthat thereference is relative to the pc (e.g. ``clr x'');if.it off,thatthe reference is to the actual symbol (e.g.,``clr *$x'')..s3The remainder of the relocation word (bits 15-4)contains a symbol number in the case of externalreferences, and is unused otherwise.The first symbol is numbered 0, the second 1, etc..sh "SEE ALSO"as (I), ld (I), strip (I), nm (I)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -