]>
Commit | Line | Data |
---|---|---|
889d655f ILT |
1 | /* PowerPC NLM (NetWare Loadable Module) support for BFD. |
2 | Copyright (C) 1994 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of BFD, the Binary File Descriptor library. | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | ||
20 | /* A PowerPC NLM starts with an instance of this structure. */ | |
21 | ||
22 | struct nlm32_powerpc_external_prefix_header | |
23 | { | |
24 | /* Signature. Must be "AppleNLM". */ | |
25 | char signature[8]; | |
26 | /* Version number. Current value is 1. */ | |
27 | unsigned char headerVersion[4]; | |
28 | /* ??. Should be set to 0. */ | |
29 | unsigned char origins[4]; | |
30 | /* File creation date in standard Unix time format (seconds since | |
31 | 1/1/70). */ | |
32 | unsigned char date[4]; | |
33 | }; | |
34 | ||
35 | #define NLM32_POWERPC_SIGNATURE "AppleNLM" | |
36 | #define NLM32_POWERPC_HEADER_VERSION 1 | |
37 | ||
38 | /* The external format of a PowerPC NLM reloc. This is the same as an | |
39 | XCOFF dynamic reloc. */ | |
40 | ||
41 | struct nlm32_powerpc_external_reloc | |
42 | { | |
43 | /* Address. */ | |
44 | unsigned char l_vaddr[4]; | |
45 | /* Symbol table index. This is 0 for .text and 1 for .data. 2 | |
46 | means .bss, but I don't know if it is used. In XCOFF, larger | |
47 | numbers are indices into the dynamic symbol table, but they are | |
48 | presumably not used in an NLM. */ | |
49 | unsigned char l_symndx[4]; | |
50 | /* Relocation type. */ | |
51 | unsigned char l_rtype[2]; | |
52 | /* Section number being relocated. */ | |
53 | unsigned char l_rsecnm[2]; | |
54 | }; | |
55 | ||
56 | /* The external format of the fixed header. */ | |
57 | ||
58 | typedef struct nlm32_powerpc_external_fixed_header | |
59 | { | |
60 | ||
61 | /* The signature field identifies the file as an NLM. It must contain | |
62 | the signature string, which depends upon the NLM target. */ | |
63 | ||
64 | unsigned char signature[24]; | |
65 | ||
66 | /* The version of the header. At this time, the highest version number | |
67 | is 4. */ | |
68 | ||
69 | unsigned char version[4]; | |
70 | ||
71 | /* The name of the module, which must be a DOS name (1-8 characters followed | |
72 | by a period and a 1-3 character extension). The first byte is the byte | |
73 | length of the name and the last byte is a null terminator byte. This | |
74 | field is fixed length, and any unused bytes should be null bytes. The | |
75 | value is set by the OUTPUT keyword to NLMLINK. */ | |
76 | ||
77 | unsigned char moduleName[14]; | |
78 | ||
79 | /* Padding to make it come out correct. */ | |
80 | ||
81 | unsigned char pad1[2]; | |
82 | ||
83 | /* The byte offset of the code image from the start of the file. */ | |
84 | ||
85 | unsigned char codeImageOffset[4]; | |
86 | ||
87 | /* The size of the code image, in bytes. */ | |
88 | ||
89 | unsigned char codeImageSize[4]; | |
90 | ||
91 | /* The byte offset of the data image from the start of the file. */ | |
92 | ||
93 | unsigned char dataImageOffset[4]; | |
94 | ||
95 | /* The size of the data image, in bytes. */ | |
96 | ||
97 | unsigned char dataImageSize[4]; | |
98 | ||
99 | /* The size of the uninitialized data region that the loader is to be | |
100 | allocated at load time. Uninitialized data follows the initialized | |
101 | data in the NLM address space. */ | |
102 | ||
103 | unsigned char uninitializedDataSize[4]; | |
104 | ||
105 | /* The byte offset of the custom data from the start of the file. The | |
106 | custom data is set by the CUSTOM keyword to NLMLINK. It is possible | |
107 | for this to be EOF if there is no custom data. */ | |
108 | ||
109 | unsigned char customDataOffset[4]; | |
110 | ||
111 | /* The size of the custom data, in bytes. */ | |
112 | ||
113 | unsigned char customDataSize[4]; | |
114 | ||
115 | /* The byte offset of the module dependencies from the start of the file. | |
116 | The module dependencies are determined by the MODULE keyword in | |
117 | NLMLINK. */ | |
118 | ||
119 | unsigned char moduleDependencyOffset[4]; | |
120 | ||
121 | /* The number of module dependencies at the moduleDependencyOffset. */ | |
122 | ||
123 | unsigned char numberOfModuleDependencies[4]; | |
124 | ||
125 | /* The byte offset of the relocation fixup data from the start of the file */ | |
126 | ||
127 | unsigned char relocationFixupOffset[4]; | |
128 | ||
129 | unsigned char numberOfRelocationFixups[4]; | |
130 | ||
131 | unsigned char externalReferencesOffset[4]; | |
132 | ||
133 | unsigned char numberOfExternalReferences[4]; | |
134 | ||
135 | unsigned char publicsOffset[4]; | |
136 | ||
137 | unsigned char numberOfPublics[4]; | |
138 | ||
139 | /* The byte offset of the internal debug info from the start of the file. | |
140 | It is possible for this to be EOF if there is no debug info. */ | |
141 | ||
142 | unsigned char debugInfoOffset[4]; | |
143 | ||
144 | unsigned char numberOfDebugRecords[4]; | |
145 | ||
146 | unsigned char codeStartOffset[4]; | |
147 | ||
148 | unsigned char exitProcedureOffset[4]; | |
149 | ||
150 | unsigned char checkUnloadProcedureOffset[4]; | |
151 | ||
152 | unsigned char moduleType[4]; | |
153 | ||
154 | unsigned char flags[4]; | |
155 | ||
156 | } Nlm32_powerpc_External_Fixed_Header; |