|
|
1.1 ! root 1: /* ! 2: * This is the format of the 'l.out' ! 3: ! 4: * file with 32-bit addressing (for ! 5: * assembler, linkage editor, and compiler). ! 6: * It also has the namelist structure for ! 7: * the nlist routine. ! 8: */ ! 9: #ifndef L_OUT_H ! 10: #define L_OUT_H ! 11: #include "types.h" ! 12: ! 13: #define NCPLN 16 /* Chars in loader name */ ! 14: #define NLSEG 9 /* No. of segments */ ! 15: #define NXSEG 6 /* No. of segments used by exec */ ! 16: #define L_MAGIC 0407 /* Magic number */ ! 17: ! 18: /* ! 19: * This is the header. ! 20: * It sits at the front of the file, ! 21: * holding control information and ! 22: * the sizes of the other segments ! 23: * of the file. ! 24: */ ! 25: struct ldheader { ! 26: short l_magic; /* Magic number */ ! 27: short l_flag; /* Flags */ ! 28: short l_machine; /* Type of target machine */ ! 29: short l_tbase; /* Text starts here */ ! 30: long l_ssize[NLSEG]; /* Segment sizes */ ! 31: long l_entry; /* Entry point */ ! 32: }; ! 33: ! 34: /* Flags */ ! 35: #define LF_SHR 01 /* Bound shared */ ! 36: #define LF_SEP 02 /* Bound separated */ ! 37: #define LF_NRB 04 /* No reloc. bits */ ! 38: #define LF_KER 010 /* Loadable driver */ ! 39: #define LF_32 020 /* 32-bit format l.out */ ! 40: #define LF_SLREF 040 /* References shared library */ ! 41: #define LF_SLIB 0100 /* Is the shared library */ ! 42: #define LF_DEBUG 0200 /* Debug on entry */ ! 43: ! 44: /* Formats */ ! 45: #define AFMT "%08lx" /* Address */ ! 46: ! 47: /* Machines */ ! 48: #ifndef MTYPE_H ! 49: #include "mtype.h" ! 50: #endif ! 51: ! 52: /* Segments */ ! 53: #define L_SHRI 0 /* Shared Instruction space */ ! 54: #define L_PRVI 1 /* Private Instruction space */ ! 55: #define L_BSSI 2 /* Uninitialised Instruction */ ! 56: #define L_SHRD 3 /* Shared Data space */ ! 57: #define L_PRVD 4 /* Private Data space */ ! 58: #define L_BSSD 5 /* Uninitalised Data */ ! 59: #define L_DEBUG 6 /* Debug tables */ ! 60: #define L_SYM 7 /* Symbols */ ! 61: #define L_REL 8 /* Relocation */ ! 62: ! 63: #define L_ABS 9 /* Absolute (symbol table) */ ! 64: #define L_REF 10 /* Reference (symbol table) */ ! 65: ! 66: /* ! 67: * Symbol. ! 68: * These live in the 'L_SYM' section ! 69: * of the file; the size of this section ! 70: * determines the number of symbols. ! 71: */ ! 72: struct ldsym { ! 73: char ls_id[NCPLN]; /* Symbol name */ ! 74: short ls_type; /* Global + Seg. */ ! 75: long ls_addr; /* Value of symbol */ ! 76: }; ! 77: ! 78: /* ! 79: * The nlist structure for the nlist routine. ! 80: */ ! 81: struct nlist { ! 82: char n_name[NCPLN]; /* Symbol name */ ! 83: short n_type; /* Type flag */ ! 84: long n_value; /* Value */ ! 85: }; ! 86: ! 87: #define L_GLOBAL 020 ! 88: ! 89: /* ! 90: * Relocation. ! 91: * Relocation is a byte stream. ! 92: * The first is an opcode. ! 93: * If L_SYM-based relocation, the next two ! 94: * bytes are symbol number. ! 95: * The next 4 bytes are the address ! 96: * of relocation. ! 97: */ ! 98: #define LR_SEG 017 /* Seg., L_SYM => Sym. based */ ! 99: #define LR_PCR 020 /* PC Rel. flag */ ! 100: #define LR_OP 0340 /* Opcode */ ! 101: ! 102: #define LR_BYTE (0<<5) /* Rel. a byte */ ! 103: #define LR_WORD (1<<5) /* Rel. a word */ ! 104: #define LR_LONG (2<<5) /* Rel. a long */ ! 105: ! 106: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.