HLE: Split the LOCK and REP prefix slots
[nasm/nasm.git] / output / outform.h
blobd37a61b44fce4a46485cdd48cb818999f4512a44
1 /* ----------------------------------------------------------------------- *
3 * Copyright 1996-2011 The NASM Authors - All Rights Reserved
4 * See the file AUTHORS included with the NASM distribution for
5 * the specific copyright holders.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following
9 * conditions are met:
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 * ----------------------------------------------------------------------- */
35 * outform.h header file for binding output format drivers to the
36 * remainder of the code in the Netwide Assembler
40 * This header file allows configuration of which output formats
41 * get compiled into the NASM binary. You can configure by defining
42 * various preprocessor symbols beginning with "OF_", either on the
43 * compiler command line or at the top of this file.
45 * OF_ONLY -- only include specified object formats
46 * OF_name -- ensure that output format 'name' is included
47 * OF_NO_name -- remove output format 'name'
48 * OF_DOS -- ensure that 'obj', 'bin', 'win32' & 'win64' are included.
49 * OF_UNIX -- ensure that 'aout', 'aoutb', 'coff', 'elf32' & 'elf64' are in.
50 * OF_OTHERS -- ensure that 'bin', 'as86', 'rdf' 'macho32' & 'macho64' are in.
51 * OF_ALL -- ensure that all formats are included.
52 * note that this doesn't include 'dbg', which is
53 * only really useful if you're doing development
54 * work on NASM. Define OF_DBG if you want this.
56 * OF_DEFAULT=of_name -- ensure that 'name' is the default format.
58 * eg: -DOF_UNIX -DOF_ELF32 -DOF_DEFAULT=of_elf32 would be a suitable config
59 * for an average linux system.
61 * Default config = -DOF_ALL -DOF_DEFAULT=of_bin
63 * You probably only want to set these options while compiling 'nasm.c'. */
65 #ifndef NASM_OUTFORM_H
66 #define NASM_OUTFORM_H
68 #include "nasm.h"
70 /* -------------- USER MODIFIABLE PART ---------------- */
73 * Insert #defines here in accordance with the configuration
74 * instructions above.
76 * E.g.
78 * #define OF_ONLY
79 * #define OF_OBJ
80 * #define OF_BIN
82 * for a 16-bit DOS assembler with no extraneous formats.
85 /* ------------ END USER MODIFIABLE PART -------------- */
87 /* ====configurable info begins here==== */
88 /* formats configurable:
89 * bin,obj,elf32,elf64,aout,aoutb,coff,win32,as86,rdf2,macho32,macho64 */
91 /* process options... */
93 #ifndef OF_ONLY
94 #ifndef OF_ALL
95 #define OF_ALL /* default is to have all formats */
96 #endif
97 #endif
99 #ifdef OF_ALL /* set all formats on... */
100 #ifndef OF_BIN
101 #define OF_BIN
102 #endif
103 #ifndef OF_OBJ
104 #define OF_OBJ
105 #endif
106 #ifndef OF_ELF32
107 #define OF_ELF32
108 #endif
109 #ifndef OF_ELFX32
110 #define OF_ELFX32
111 #endif
112 #ifndef OF_ELF64
113 #define OF_ELF64
114 #endif
115 #ifndef OF_COFF
116 #define OF_COFF
117 #endif
118 #ifndef OF_AOUT
119 #define OF_AOUT
120 #endif
121 #ifndef OF_AOUTB
122 #define OF_AOUTB
123 #endif
124 #ifndef OF_WIN32
125 #define OF_WIN32
126 #endif
127 #ifndef OF_WIN64
128 #define OF_WIN64
129 #endif
130 #ifndef OF_AS86
131 #define OF_AS86
132 #endif
133 #ifndef OF_RDF2
134 #define OF_RDF2
135 #endif
136 #ifndef OF_IEEE
137 #define OF_IEEE
138 #endif
139 #ifndef OF_MACHO32
140 #define OF_MACHO32
141 #endif
142 #ifndef OF_MACHO64
143 #define OF_MACHO64
144 #endif
145 #ifndef OF_DBG
146 #define OF_DBG
147 #endif
148 #endif /* OF_ALL */
150 /* turn on groups of formats specified.... */
151 #ifdef OF_DOS
152 #ifndef OF_OBJ
153 #define OF_OBJ
154 #endif
155 #ifndef OF_BIN
156 #define OF_BIN
157 #endif
158 #ifndef OF_COFF
159 #define OF_COFF /* COFF is used by DJGPP */
160 #endif
161 #ifndef OF_WIN32
162 #define OF_WIN32
163 #endif
164 #ifndef OF_WIN64
165 #define OF_WIN64
166 #endif
167 #endif
169 #ifdef OF_UNIX
170 #ifndef OF_AOUT
171 #define OF_AOUT
172 #endif
173 #ifndef OF_AOUTB
174 #define OF_AOUTB
175 #endif
176 #ifndef OF_COFF
177 #define OF_COFF
178 #endif
179 #ifndef OF_ELF32
180 #define OF_ELF32
181 #endif
182 #ifndef OF_ELF64
183 #define OF_ELF64
184 #endif
185 #ifndef OF_ELFX32
186 #define OF_ELFX32
187 #endif
188 #endif
190 #ifdef OF_OTHERS
191 #ifndef OF_BIN
192 #define OF_BIN
193 #endif
194 #ifndef OF_AS86
195 #define OF_AS86
196 #endif
197 #ifndef OF_RDF2
198 #define OF_RDF2
199 #endif
200 #ifndef OF_IEEE
201 #define OF_IEEE
202 #endif
203 #ifndef OF_MACHO32
204 #define OF_MACHO32
205 #endif
206 #ifndef OF_MACHO64
207 #define OF_MACHO64
208 #endif
209 #endif
211 /* finally... override any format specifically specified to be off */
212 #ifdef OF_NO_BIN
213 #undef OF_BIN
214 #endif
215 #ifdef OF_NO_OBJ
216 #undef OF_OBJ
217 #endif
218 #ifdef OF_NO_ELF32
219 #undef OF_ELF32
220 #endif
221 #ifdef OF_NO_ELF64
222 #undef OF_ELF64
223 #endif
224 #ifdef OF_NO_ELFX32
225 #undef OF_ELFX32
226 #endif
227 #ifdef OF_NO_AOUT
228 #undef OF_AOUT
229 #endif
230 #ifdef OF_NO_AOUTB
231 #undef OF_AOUTB
232 #endif
233 #ifdef OF_NO_COFF
234 #undef OF_COFF
235 #endif
236 #ifdef OF_NO_WIN32
237 #undef OF_WIN32
238 #endif
239 #ifdef OF_NO_WIN64
240 #undef OF_WIN64
241 #endif
242 #ifdef OF_NO_AS86
243 #undef OF_AS86
244 #endif
245 #ifdef OF_NO_RDF2
246 #undef OF_RDF2
247 #endif
248 #ifdef OF_NO_IEEE
249 #undef OF_IEEE
250 #endif
251 #ifdef OF_NO_MACHO32
252 #undef OF_MACHO32
253 #endif
254 #ifdef OF_NO_MACHO64
255 #undef OF_MACHO64
256 #endif
257 #ifdef OF_NO_DBG
258 #undef OF_DBG
259 #endif
261 #ifndef OF_DEFAULT
262 #define OF_DEFAULT of_bin
263 #endif
265 extern struct ofmt of_bin;
266 extern struct ofmt of_ith;
267 extern struct ofmt of_srec;
268 extern struct ofmt of_aout;
269 extern struct ofmt of_aoutb;
270 extern struct ofmt of_coff;
271 extern struct ofmt of_elf32;
272 extern struct ofmt of_elfx32;
273 extern struct ofmt of_elf64;
274 extern struct ofmt of_as86;
275 extern struct ofmt of_obj;
276 extern struct ofmt of_win32;
277 extern struct ofmt of_win64;
278 extern struct ofmt of_rdf2;
279 extern struct ofmt of_ieee;
280 extern struct ofmt of_macho32;
281 extern struct ofmt of_macho64;
282 extern struct ofmt of_dbg;
284 #ifdef BUILD_DRIVERS_ARRAY /* only if included from outform.c */
287 * pull in the externs for the different formats, then make the
288 * drivers array based on the above defines
291 static struct ofmt *drivers[] = {
292 #ifdef OF_BIN
293 &of_bin,
294 &of_ith,
295 &of_srec,
296 #endif
297 #ifdef OF_AOUT
298 &of_aout,
299 #endif
300 #ifdef OF_AOUTB
301 &of_aoutb,
302 #endif
303 #ifdef OF_COFF
304 &of_coff,
305 #endif
306 #ifdef OF_ELF32
307 &of_elf32,
308 #endif
309 #ifdef OF_ELF64
310 &of_elf64,
311 #endif
312 #ifdef OF_ELFX32
313 &of_elfx32,
314 #endif
315 #ifdef OF_AS86
316 &of_as86,
317 #endif
318 #ifdef OF_OBJ
319 &of_obj,
320 #endif
321 #ifdef OF_WIN32
322 &of_win32,
323 #endif
324 #ifdef OF_WIN64
325 &of_win64,
326 #endif
327 #ifdef OF_RDF2
328 &of_rdf2,
329 #endif
330 #ifdef OF_IEEE
331 &of_ieee,
332 #endif
333 #ifdef OF_MACHO32
334 &of_macho32,
335 #endif
336 #ifdef OF_MACHO64
337 &of_macho64,
338 #endif
339 #ifdef OF_DBG
340 &of_dbg,
341 #endif
343 NULL
346 static struct ofmt_alias ofmt_aliases[] = {
347 #ifdef OF_ELF32
349 "elf",
350 "ELF (short name for ELF32)",
351 &of_elf32,
353 #endif
354 #ifdef OF_MACHO32
356 "macho",
357 "MACHO (short name for MACHO32)",
358 &of_macho32,
360 #endif
361 #ifdef OF_WIN32
363 "win",
364 "WIN (short name for WIN32)",
365 &of_win32,
367 #endif
368 { NULL, NULL, NULL }
371 #endif /* BUILD_DRIVERS_ARRAY */
373 struct ofmt *ofmt_find(char *name, struct ofmt_alias **ofmt_alias);
374 struct dfmt *dfmt_find(struct ofmt *, char *);
375 void ofmt_list(struct ofmt *, FILE *);
376 void dfmt_list(struct ofmt *ofmt, FILE * fp);
377 struct ofmt *ofmt_register(efunc error);
378 extern struct dfmt null_debug_form;
380 #endif /* NASM_OUTFORM_H */