|
|
1.1 root 1: /*
2: * COFF relocation file.
3: */
4:
5: struct reloc {
6: long r_vaddr; /* (virtual) address of reference */
7: long r_symndx; /* index into symbol table */
8: unsigned short r_type; /* relocation type */
9: };
10:
11:
12: /*
13: * relocation types for all products and generics
14: */
15:
16: /*
17: * All generics
18: * reloc. already performed to symbol in the same section
19: */
20: #define R_ABS 0
21:
22: /*
23: * X86 generic
24: * 8-bit offset reference in 8-bits
25: * 8-bit offset reference in 16-bits
26: * 12-bit segment reference
27: * auxiliary relocation entry
28: */
29: #define R_OFF8 07
30: #define R_OFF16 010
31: #define R_SEG12 011
32: #define R_AUX 013
33:
34: /*
35: * B16 and X86 generics
36: * 16-bit direct reference
37: * 16-bit "relative" reference
38: * 16-bit "indirect" (TV) reference
39: */
40: #define R_DIR16 01
41: #define R_REL16 02
42: #define R_IND16 03
43:
44: /*
45: * 3B generic
46: * 24-bit direct reference
47: * 24-bit "relative" reference
48: * 16-bit optimized "indirect" TV reference
49: * 24-bit "indirect" TV reference
50: * 32-bit "indirect" TV reference
51: */
52: #define R_DIR24 04
53: #define R_REL24 05
54: #define R_OPT16 014
55: #define R_IND24 015
56: #define R_IND32 016
57:
58: /*
59: * 3B and M32 generics
60: * 32-bit direct reference
61: */
62: #define R_DIR32 06
63:
64: /*
65: * M32 generic
66: * 32-bit direct reference with bytes swapped
67: */
68: #define R_DIR32S 012
69:
70: /*
71: * DEC Processors VAX 11/780 and VAX 11/750
72: *
73: */
74:
75: #define R_RELBYTE 017
76: #define R_RELWORD 020
77: #define R_RELLONG 021
78: #define R_PCRBYTE 022
79: #define R_PCRWORD 023
80: #define R_PCRLONG 024
81:
82: /*
83: * Motorolla 68000
84: */
85:
86: /* uses R_RELBYTE, R_RELWORD, R_RELLONG, R_PCRBYTE and R_PCRWORD as for
87: * DEC machines above
88: */
89:
90: #define RELOC struct reloc
91: #define RELSZ 10 /* sizeof(RELOC) */
92:
93: /* Definition of a "TV" relocation type */
94:
95: #if N3B || U3B
96: #define ISTVRELOC(x) ((x==R_OPT16)||(x==R_IND24)||(x==R_IND32))
97: #endif
98: #if B16 || X86 || IAPX
99: #define ISTVRELOC(x) (x==R_IND16)
100: #endif
101: #if M32
102: #define ISTVRELOC(x) (x!=x) /* never the case */
103: #endif
104: #if MC68
105: #define ISTVRELOC(x) ((x == R_IND16) || (x == R_IND32))
106: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.