Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!sdcsvax!ucbvax!DHDIHEP1.BITNET!WALDI From: WALDI@DHDIHEP1.BITNET Newsgroups: comp.sys.atari.st Subject: relocatable PRG Message-ID: <8710211026.AA00597@ucbvax.Berkeley.EDU> Date: Wed, 21-Oct-87 06:26:46 EDT Article-I.D.: ucbvax.8710211026.AA00597 Posted: Wed Oct 21 06:26:46 1987 Date-Received: Fri, 23-Oct-87 03:47:11 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 70 Date: 21 October 1987, 11:13:09 SET From: Roland Waldi phone (6221) 564334 WALDI at DHDIHEP1 Inst. fuer Hochenergiephysik D-6900 Heidelberg To: INFO-ATA at SCORE.ST Someone asked for the format of relocatable program files. Here it is to the best of my knowlegde, however I never checked if this is correct: HEADER (28bytes) +--------+--------+ 0 | $601A | +--------+--------+--------+--------+ 2 | Number of bytes in text segment | +--------+--------+--------+--------+ 6 | Number of bytes in data segment | +--------+--------+--------+--------+ 10 | Number of bytes in bss | +--------+--------+--------+--------+ 14 | Number of bytes in symbol table | +--------+--------+--------+--------+ 18 | Reserved, must be 0 | +--------+--------+--------+--------+ 22 | Reserved, must be 0 | +--------+--------+--------+--------+ 26 | Reserved | +--------+--------+ TEXT (program) and DATA segments +--------....-----+ | | +--------....-----+ SYMBOL TABLE (optional) +--------+--------+--------+----...----+ entry_1 +0 | Symbol Name | +--------+--------+-------------...----+ +8 | Type *) | +--------+--------+--------+--------+ +10 | Value | +--------+--------+--------+--------+ entry_2 +14 ... +--------+--------+--------+--------+ ... *) Symbol Types: $0100 bss-based relocatable $0200 text-based relocatable $0400 data-based relocatable $0800 external reference (value = size of common region) $1000 equated register (value = register number) $2000 global $4000 equated $8000 defined RELOCATION TABLE (if relocatable) +--------+--------+--------+--------+ +0 | Offset of 1st longword to | | relocate (relative to start of | | TEXT segment) | +--------+--------+--------+--------+ +4 | Offset | +--------+ +5 | Offset | +--------+ . ... . +--------+ | 0-byte | +--------+ Offset counts the byte distance to the next longword to relocate. If there are more than 254 bytes, an Offset-value of 1 indicates that 254 should be added to the offset counter.