Commit | Line | Data |
---|---|---|
fecd2382 | 1 | /* as.h - global header file |
3340f7e5 | 2 | Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc. |
6efd877d | 3 | |
a39116f1 | 4 | This file is part of GAS, the GNU Assembler. |
6efd877d | 5 | |
a39116f1 RP |
6 | GAS 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, or (at your option) | |
9 | any later version. | |
6efd877d | 10 | |
a39116f1 RP |
11 | GAS 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. | |
6efd877d | 15 | |
a39116f1 RP |
16 | You should have received a copy of the GNU General Public License |
17 | along with GAS; see the file COPYING. If not, write to | |
18 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
fecd2382 | 19 | |
7f955c18 | 20 | #ifndef GAS |
fecd2382 | 21 | #define GAS 1 |
fecd2382 RP |
22 | /* |
23 | * I think this stuff is largely out of date. xoxorich. | |
24 | * | |
25 | * CAPITALISED names are #defined. | |
26 | * "lowercaseH" is #defined if "lowercase.h" has been #include-d. | |
27 | * "lowercaseT" is a typedef of "lowercase" objects. | |
28 | * "lowercaseP" is type "pointer to object of type 'lowercase'". | |
29 | * "lowercaseS" is typedef struct ... lowercaseS. | |
30 | * | |
31 | * #define DEBUG to enable all the "know" assertion tests. | |
68878ef1 | 32 | * #define SUSPECT when debugging hash code. |
fecd2382 RP |
33 | * #define COMMON as "extern" for all modules except one, where you #define |
34 | * COMMON as "". | |
35 | * If TEST is #defined, then we are testing a module: #define COMMON as "". | |
36 | */ | |
37 | ||
38 | /* These #defines are for parameters of entire assembler. */ | |
39 | ||
b11fb939 | 40 | /* For some systems, this is required to be first. */ |
a48f997a | 41 | #include "libiberty/alloca-conf.h" |
fecd2382 | 42 | |
b11fb939 | 43 | /* Now, tend to the rest of the configuration. */ |
7f955c18 KR |
44 | #include "config.h" |
45 | ||
b11fb939 | 46 | /* System include files first... */ |
fecd2382 | 47 | #include <stdio.h> |
b11fb939 KR |
48 | #include <ctype.h> |
49 | #ifdef HAVE_STRING_H | |
50 | #include <string.h> | |
51 | #else | |
52 | #include <strings.h> | |
53 | #endif | |
54 | #ifdef HAVE_STDLIB_H | |
55 | #include <stdlib.h> | |
56 | #endif | |
57 | #ifdef HAVE_UNISTD_H | |
58 | #include <unistd.h> | |
59 | #endif | |
60 | #ifdef HAVE_SYS_TYPES_H | |
61 | /* for size_t, pid_t */ | |
62 | #include <sys/types.h> | |
63 | #endif | |
64 | ||
65 | /* Some systems do declare this, but this seems to be the universal | |
66 | declaration, though the parameter type varies. (It ought to use | |
67 | `const' but many systems prototype it without.) Include it here | |
68 | for systems that don't declare it. If conflicts arise, just add | |
69 | another autoconf test... */ | |
70 | extern char *strdup (/* const char * */); | |
71 | ||
f3d817d8 DM |
72 | #include <getopt.h> |
73 | /* The first getopt value for machine-independent long options. | |
74 | 150 isn't special; it's just an arbitrary non-ASCII char value. */ | |
75 | #define OPTION_STD_BASE 150 | |
76 | /* The first getopt value for machine-dependent long options. | |
77 | 170 gives the standard options room to grow. */ | |
78 | #define OPTION_MD_BASE 170 | |
79 | ||
68878ef1 KR |
80 | #ifdef DEBUG |
81 | #undef NDEBUG | |
82 | #endif | |
b11fb939 KR |
83 | /* Handle lossage with assert.h. */ |
84 | #ifndef BROKEN_ASSERT | |
fecd2382 | 85 | #include <assert.h> |
b11fb939 KR |
86 | #else /* BROKEN_ASSERT */ |
87 | #ifndef NDEBUG | |
88 | #define assert(p) ((p) ? 0 : (abort(), 0)) | |
89 | #else | |
90 | #define assert(p) ((p), 0) | |
91 | #endif | |
92 | #endif /* BROKEN_ASSERT */ | |
c593cf41 | 93 | |
b11fb939 KR |
94 | |
95 | /* Now GNU header files... */ | |
68878ef1 KR |
96 | #include <ansidecl.h> |
97 | #ifdef BFD_ASSEMBLER | |
98 | #include <bfd.h> | |
99 | #endif | |
b11fb939 KR |
100 | |
101 | #ifdef WANT_FOPEN_BIN | |
102 | #include "fopen-bin.h" | |
103 | #else | |
104 | #include "fopen-same.h" | |
105 | #endif | |
106 | ||
107 | /* This doesn't get taken care of by ansidecl.h. */ | |
108 | #if !defined (__STDC__) && !defined (volatile) | |
109 | #define volatile | |
110 | #endif | |
111 | ||
112 | /* This doesn't get taken care of anywhere. */ | |
113 | #if !defined (__GNUC__) && !defined (inline) | |
114 | #define inline | |
115 | #endif | |
116 | ||
117 | /* Other stuff from config.h. */ | |
118 | #ifdef NEED_MALLOC_DECLARATION | |
119 | extern PTR malloc (); | |
120 | extern PTR realloc (); | |
121 | #endif | |
122 | #ifdef NEED_FREE_DECLARATION | |
123 | extern void free (); | |
124 | #endif | |
125 | ||
126 | #ifdef BFD_ASSEMBLER | |
127 | /* This one doesn't get declared, but we're using it anyways. This | |
128 | should be fixed -- either it's part of the external interface or | |
129 | it's not. */ | |
130 | extern PTR bfd_alloc_by_size_t PARAMS ((bfd *abfd, size_t sz)); | |
131 | #endif | |
68878ef1 | 132 | |
b17c891e KR |
133 | /* Make Saber happier on obstack.h. */ |
134 | #ifdef SABER | |
135 | #undef __PTR_TO_INT | |
136 | #define __PTR_TO_INT(P) ((int)(P)) | |
137 | #undef __INT_TO_PTR | |
138 | #define __INT_TO_PTR(P) ((char *)(P)) | |
139 | #endif | |
140 | ||
68878ef1 KR |
141 | #ifndef __LINE__ |
142 | #define __LINE__ "unknown" | |
143 | #endif /* __LINE__ */ | |
144 | ||
145 | #ifndef __FILE__ | |
146 | #define __FILE__ "unknown" | |
147 | #endif /* __FILE__ */ | |
148 | ||
b17c891e KR |
149 | #ifndef __STDC__ |
150 | #ifndef const | |
151 | #define const | |
152 | #endif | |
153 | #ifndef volatile | |
154 | #define volatile | |
155 | #endif | |
156 | #endif /* ! __STDC__ */ | |
157 | ||
98c6bbbe KR |
158 | #if !defined (__GNUC__) && !defined (inline) |
159 | #define inline | |
160 | #endif | |
161 | ||
7f955c18 | 162 | #ifndef FOPEN_WB |
b11fb939 KR |
163 | #ifdef GO32 |
164 | #include "fopen-bin.h" | |
165 | #else | |
7f955c18 KR |
166 | #include "fopen-same.h" |
167 | #endif | |
b11fb939 | 168 | #endif |
7f955c18 | 169 | |
3340f7e5 RP |
170 | #define obstack_chunk_alloc xmalloc |
171 | #define obstack_chunk_free xfree | |
fecd2382 | 172 | |
a39116f1 RP |
173 | #define xfree free |
174 | ||
b17c891e | 175 | #define BAD_CASE(val) \ |
a39116f1 | 176 | { \ |
58d4951d ILT |
177 | as_fatal("Case value %ld unexpected at line %d of file \"%s\"\n", \ |
178 | (long) val, __LINE__, __FILE__); \ | |
a39116f1 | 179 | } |
a193acc0 ILT |
180 | |
181 | /* Version 2.1 of Solaris had problems with this declaration, but I | |
182 | think that bug has since been fixed. If it causes problems on your | |
183 | system, just delete it. */ | |
184 | extern char *strstr (); | |
fecd2382 | 185 | \f |
b11fb939 | 186 | #include "flonum.h" |
6efd877d | 187 | |
fecd2382 RP |
188 | /* These are assembler-wide concepts */ |
189 | ||
68878ef1 KR |
190 | #ifdef BFD_ASSEMBLER |
191 | extern bfd *stdoutput; | |
b17c891e KR |
192 | typedef bfd_vma addressT; |
193 | typedef bfd_signed_vma offsetT; | |
194 | #else | |
195 | typedef unsigned long addressT; | |
196 | typedef long offsetT; | |
68878ef1 | 197 | #endif |
fecd2382 | 198 | |
b17c891e KR |
199 | /* Type of symbol value, etc. For use in prototypes. */ |
200 | typedef addressT valueT; | |
201 | ||
fecd2382 RP |
202 | #ifndef COMMON |
203 | #ifdef TEST | |
204 | #define COMMON /* declare our COMMONs storage here. */ | |
205 | #else | |
206 | #define COMMON extern /* our commons live elswhere */ | |
207 | #endif | |
208 | #endif | |
a39116f1 | 209 | /* COMMON now defined */ |
c8c7e0bf | 210 | |
fecd2382 | 211 | #ifdef DEBUG |
ace68c4e | 212 | #ifndef know |
fecd2382 | 213 | #define know(p) assert(p) /* Verify our assumptions! */ |
ace68c4e | 214 | #endif /* not yet defined */ |
fecd2382 RP |
215 | #else |
216 | #define know(p) /* know() checks are no-op.ed */ | |
217 | #endif | |
fecd2382 RP |
218 | \f |
219 | /* input_scrub.c */ | |
220 | ||
221 | /* | |
222 | * Supplies sanitised buffers to read.c. | |
223 | * Also understands printing line-number part of error messages. | |
224 | */ | |
fecd2382 | 225 | \f |
6efd877d | 226 | |
fecd2382 RP |
227 | /* subsegs.c Sub-segments. Also, segment(=expression type)s.*/ |
228 | ||
68878ef1 | 229 | #ifndef BFD_ASSEMBLER |
ace68c4e | 230 | |
58721107 | 231 | #ifdef MANY_SEGMENTS |
c8c7e0bf | 232 | #include "bfd.h" |
ace68c4e | 233 | #define N_SEGMENTS 10 |
58721107 | 234 | #define SEG_NORMAL(x) ((x) >= SEG_E0 && (x) <= SEG_E9) |
ace68c4e | 235 | #define SEG_LIST SEG_E0,SEG_E1,SEG_E2,SEG_E3,SEG_E4,SEG_E5,SEG_E6,SEG_E7,SEG_E8,SEG_E9 |
ada269da | 236 | #define SEG_TEXT SEG_E0 |
68878ef1 | 237 | #define SEG_DATA SEG_E1 |
ada269da | 238 | #define SEG_BSS SEG_E2 |
58721107 | 239 | #else |
ace68c4e | 240 | #define N_SEGMENTS 3 |
58721107 | 241 | #define SEG_NORMAL(x) ((x) == SEG_TEXT || (x) == SEG_DATA || (x) == SEG_BSS) |
ace68c4e | 242 | #define SEG_LIST SEG_TEXT,SEG_DATA,SEG_BSS |
58721107 SC |
243 | #endif |
244 | ||
6efd877d KR |
245 | typedef enum _segT |
246 | { | |
247 | SEG_ABSOLUTE = 0, | |
248 | SEG_LIST, | |
249 | SEG_UNKNOWN, | |
6efd877d KR |
250 | SEG_GOOF, /* Only happens if AS has a logic error. */ |
251 | /* Invented so we don't crash printing */ | |
252 | /* error message involving weird segment. */ | |
58d4951d | 253 | SEG_EXPR, /* Intermediate expression values. */ |
6efd877d KR |
254 | SEG_DEBUG, /* Debug segment */ |
255 | SEG_NTV, /* Transfert vector preload segment */ | |
256 | SEG_PTV, /* Transfert vector postload segment */ | |
b17c891e | 257 | SEG_REGISTER /* Mythical: a register-valued expression */ |
6efd877d | 258 | } segT; |
fecd2382 RP |
259 | |
260 | #define SEG_MAXIMUM_ORDINAL (SEG_REGISTER) | |
68878ef1 KR |
261 | #else |
262 | typedef asection *segT; | |
263 | #define SEG_NORMAL(SEG) ((SEG) != absolute_section \ | |
264 | && (SEG) != undefined_section \ | |
68878ef1 | 265 | && (SEG) != reg_section \ |
58d4951d | 266 | && (SEG) != expr_section) |
68878ef1 | 267 | #endif |
fecd2382 RP |
268 | typedef int subsegT; |
269 | ||
a39116f1 | 270 | /* What subseg we are accreting now? */ |
7f2cb270 | 271 | COMMON subsegT now_subseg; |
fecd2382 | 272 | |
a39116f1 | 273 | /* Segment our instructions emit to. */ |
7f2cb270 | 274 | COMMON segT now_seg; |
fecd2382 | 275 | |
68878ef1 KR |
276 | #ifdef BFD_ASSEMBLER |
277 | #define segment_name(SEG) bfd_get_section_name (stdoutput, SEG) | |
278 | #else | |
b17c891e | 279 | extern char *const seg_name[]; |
68878ef1 KR |
280 | #define segment_name(SEG) seg_name[(int) (SEG)] |
281 | #endif | |
282 | ||
283 | #ifndef BFD_ASSEMBLER | |
fecd2382 | 284 | extern int section_alignment[]; |
68878ef1 | 285 | #endif |
fecd2382 | 286 | |
68878ef1 | 287 | #ifdef BFD_ASSEMBLER |
58d4951d | 288 | extern segT reg_section, expr_section; |
68878ef1 KR |
289 | /* Shouldn't these be eliminated someday? */ |
290 | extern segT text_section, data_section, bss_section; | |
b11fb939 KR |
291 | #define absolute_section bfd_abs_section_ptr |
292 | #define undefined_section bfd_und_section_ptr | |
68878ef1 | 293 | #else |
68878ef1 | 294 | #define reg_section SEG_REGISTER |
58d4951d | 295 | #define expr_section SEG_EXPR |
68878ef1 KR |
296 | #define text_section SEG_TEXT |
297 | #define data_section SEG_DATA | |
298 | #define bss_section SEG_BSS | |
299 | #define absolute_section SEG_ABSOLUTE | |
300 | #define undefined_section SEG_UNKNOWN | |
301 | #endif | |
fecd2382 RP |
302 | |
303 | /* relax() */ | |
304 | ||
6efd877d KR |
305 | typedef enum _relax_state |
306 | { | |
7f2cb270 KR |
307 | /* Variable chars to be repeated fr_offset times. |
308 | Fr_symbol unused. Used with fr_offset == 0 for a | |
309 | constant length frag. */ | |
310 | rs_fill = 1, | |
6efd877d | 311 | |
98c6bbbe | 312 | /* Align: Fr_offset: power of 2. Variable chars: fill pattern. */ |
7f2cb270 | 313 | rs_align, |
6efd877d | 314 | |
7f2cb270 KR |
315 | /* Org: Fr_offset, fr_symbol: address. 1 variable char: fill |
316 | character. */ | |
317 | rs_org, | |
6efd877d | 318 | |
b17c891e | 319 | rs_machine_dependent |
6efd877d | 320 | |
fecd2382 | 321 | #ifndef WORKING_DOT_WORD |
7f2cb270 | 322 | /* JF: gunpoint */ |
b17c891e | 323 | , rs_broken_word |
fecd2382 | 324 | #endif |
6efd877d | 325 | } relax_stateT; |
fecd2382 RP |
326 | |
327 | /* typedef unsigned char relax_substateT; */ | |
328 | /* JF this is more likely to leave the end of a struct frag on an align | |
329 | boundry. Be very careful with this. */ | |
330 | typedef unsigned long relax_substateT; | |
331 | ||
7f2cb270 KR |
332 | /* Enough bits for address, but still an integer type. |
333 | Could be a problem, cross-assembling for 64-bit machines. */ | |
b17c891e | 334 | typedef addressT relax_addressT; |
fecd2382 | 335 | \f |
6efd877d | 336 | |
fecd2382 RP |
337 | /* frags.c */ |
338 | ||
339 | /* | |
340 | * A code fragment (frag) is some known number of chars, followed by some | |
341 | * unknown number of chars. Typically the unknown number of chars is an | |
342 | * instruction address whose size is yet unknown. We always know the greatest | |
343 | * possible size the unknown number of chars may become, and reserve that | |
344 | * much room at the end of the frag. | |
345 | * Once created, frags do not change address during assembly. | |
346 | * We chain the frags in (a) forward-linked list(s). The object-file address | |
347 | * of the 1st char of a frag is generally not known until after relax(). | |
348 | * Many things at assembly time describe an address by {object-file-address | |
349 | * of a particular frag}+offset. | |
6efd877d | 350 | |
fecd2382 | 351 | BUG: it may be smarter to have a single pointer off to various different |
6efd877d | 352 | notes for different frag kinds. See how code pans |
fecd2382 | 353 | */ |
68878ef1 | 354 | struct frag |
fecd2382 | 355 | { |
7f2cb270 | 356 | /* Object file address. */ |
b17c891e | 357 | addressT fr_address; |
68878ef1 | 358 | /* Chain forward; ascending address order. Rooted in frch_root. */ |
7f2cb270 | 359 | struct frag *fr_next; |
6efd877d | 360 | |
68878ef1 | 361 | /* (Fixed) number of chars we know we have. May be 0. */ |
b17c891e | 362 | offsetT fr_fix; |
68878ef1 | 363 | /* (Variable) number of chars after above. May be 0. */ |
b17c891e | 364 | offsetT fr_var; |
7f2cb270 KR |
365 | /* For variable-length tail. */ |
366 | struct symbol *fr_symbol; | |
367 | /* For variable-length tail. */ | |
b17c891e | 368 | offsetT fr_offset; |
68878ef1 | 369 | /* Points to opcode low addr byte, for relaxation. */ |
7f2cb270 | 370 | char *fr_opcode; |
68878ef1 KR |
371 | |
372 | #ifndef NO_LISTING | |
373 | struct list_info_struct *line; | |
374 | #endif | |
375 | ||
7f2cb270 KR |
376 | /* What state is my tail in? */ |
377 | relax_stateT fr_type; | |
6efd877d | 378 | relax_substateT fr_subtype; |
7f2cb270 | 379 | |
e9296bdb KR |
380 | /* These are needed only on the NS32K machines. But since we don't |
381 | include targ-cpu.h until after this structure has been defined, | |
382 | we can't really conditionalize it. This code should be | |
383 | rearranged a bit to make that possible. | |
68878ef1 | 384 | |
e9296bdb KR |
385 | In the meantime, if we get stuck like this with any other target, |
386 | create a union here. */ | |
387 | char fr_pcrel_adjust, fr_bsr; | |
388 | ||
389 | /* Data begins here. */ | |
7f2cb270 | 390 | char fr_literal[1]; |
fecd2382 | 391 | }; |
6efd877d | 392 | |
fecd2382 | 393 | #define SIZEOF_STRUCT_FRAG \ |
e9296bdb | 394 | ((char *)zero_address_frag.fr_literal-(char *)&zero_address_frag) |
a39116f1 | 395 | /* We want to say fr_literal[0] above. */ |
fecd2382 RP |
396 | |
397 | typedef struct frag fragS; | |
398 | ||
7f2cb270 KR |
399 | /* Current frag we are building. This frag is incomplete. It is, however, |
400 | included in frchain_now. The fr_fix field is bogus; instead, use: | |
401 | obstack_next_free(&frags)-frag_now->fr_literal. */ | |
402 | COMMON fragS *frag_now; | |
b17c891e | 403 | #define frag_now_fix() ((char*)obstack_next_free (&frags) - frag_now->fr_literal) |
fecd2382 | 404 | |
7f2cb270 KR |
405 | /* For foreign-segment symbol fixups. */ |
406 | COMMON fragS zero_address_frag; | |
407 | /* For local common (N_BSS segment) fixups. */ | |
408 | COMMON fragS bss_address_frag; | |
fecd2382 RP |
409 | |
410 | /* main program "as.c" (command arguments etc) */ | |
411 | ||
def66e24 DM |
412 | COMMON unsigned char flag_no_comments; /* -f */ |
413 | COMMON unsigned char flag_debug; /* -D */ | |
414 | COMMON unsigned char flag_signed_overflow_ok; /* -J */ | |
415 | COMMON unsigned char flag_warn_displacement; /* -K */ | |
e9296bdb KR |
416 | |
417 | /* True if local symbols should be retained. */ | |
def66e24 | 418 | COMMON unsigned char flag_keep_locals; /* -L */ |
e9296bdb KR |
419 | |
420 | /* Should the data section be made read-only and appended to the text | |
421 | section? */ | |
def66e24 | 422 | COMMON unsigned char flag_readonly_data_in_text; /* -R */ |
e9296bdb KR |
423 | |
424 | /* True if warnings should be inhibited. */ | |
def66e24 | 425 | COMMON unsigned char flag_no_warnings; /* -W */ |
e9296bdb KR |
426 | |
427 | /* True if we should attempt to generate output even if non-fatal errors | |
428 | are detected. */ | |
def66e24 | 429 | COMMON unsigned char flag_always_generate_output; /* -Z */ |
fecd2382 | 430 | |
e9296bdb KR |
431 | /* This is true if the assembler should output time and space usage. */ |
432 | ||
433 | COMMON unsigned char flag_print_statistics; | |
434 | ||
7f2cb270 KR |
435 | /* name of emitted object file */ |
436 | COMMON char *out_file_name; | |
fecd2382 | 437 | |
7f2cb270 KR |
438 | /* TRUE if we need a second pass. */ |
439 | COMMON int need_pass_2; | |
09952cd9 | 440 | |
7f2cb270 KR |
441 | /* TRUE if we should do no relaxing, and |
442 | leave lots of padding. */ | |
443 | COMMON int linkrelax; | |
fecd2382 | 444 | |
7f955c18 KR |
445 | /* TRUE if we should produce a listing. */ |
446 | extern int listing; | |
447 | ||
7f2cb270 | 448 | struct _pseudo_type |
6efd877d | 449 | { |
7f2cb270 KR |
450 | /* assembler mnemonic, lower case, no '.' */ |
451 | char *poc_name; | |
452 | /* Do the work */ | |
604633ae | 453 | void (*poc_handler) PARAMS ((int)); |
7f2cb270 KR |
454 | /* Value to pass to handler */ |
455 | int poc_val; | |
456 | }; | |
6efd877d | 457 | |
7f2cb270 | 458 | typedef struct _pseudo_type pseudo_typeS; |
fecd2382 | 459 | |
68878ef1 KR |
460 | #ifdef BFD_ASSEMBLER_xxx |
461 | struct lineno_struct | |
462 | { | |
463 | alent line; | |
464 | fragS *frag; | |
465 | struct lineno_struct *next; | |
466 | }; | |
467 | typedef struct lineno_struct lineno; | |
468 | #endif | |
fecd2382 | 469 | |
68878ef1 | 470 | #if defined (__STDC__) && !defined(NO_STDARG) |
fecd2382 | 471 | |
68878ef1 KR |
472 | #if __GNUC__ >= 2 |
473 | /* for use with -Wformat */ | |
7f955c18 | 474 | #define PRINTF_LIKE(FCN) void FCN (const char *format, ...) \ |
68878ef1 | 475 | __attribute__ ((format (printf, 1, 2))) |
a57180ad ILT |
476 | #define PRINTF_WHERE_LIKE(FCN) void FCN (char *file, unsigned int line, \ |
477 | const char *format, ...) \ | |
478 | __attribute__ ((format (printf, 3, 4))) | |
68878ef1 | 479 | #else /* ANSI C with stdarg, but not GNU C */ |
7f955c18 | 480 | #define PRINTF_LIKE(FCN) void FCN (const char *format, ...) |
a57180ad ILT |
481 | #define PRINTF_WHERE_LIKE(FCN) void FCN (char *file, unsigned int line, \ |
482 | const char *format, ...) | |
68878ef1 KR |
483 | #endif |
484 | #else /* not ANSI C, or not stdarg */ | |
485 | #define PRINTF_LIKE(FCN) void FCN () | |
a57180ad | 486 | #define PRINTF_WHERE_LIKE(FCN) void FCN () |
68878ef1 | 487 | #endif |
fecd2382 | 488 | |
68878ef1 KR |
489 | PRINTF_LIKE (as_bad); |
490 | PRINTF_LIKE (as_fatal); | |
491 | PRINTF_LIKE (as_tsktsk); | |
492 | PRINTF_LIKE (as_warn); | |
a57180ad ILT |
493 | PRINTF_WHERE_LIKE (as_bad_where); |
494 | PRINTF_WHERE_LIKE (as_warn_where); | |
7f955c18 | 495 | |
b17c891e KR |
496 | void fprint_value PARAMS ((FILE *file, addressT value)); |
497 | void sprint_value PARAMS ((char *buf, addressT value)); | |
fecd2382 | 498 | |
68878ef1 KR |
499 | int had_errors PARAMS ((void)); |
500 | int had_warnings PARAMS ((void)); | |
fecd2382 | 501 | |
604633ae | 502 | void print_version_id PARAMS ((void)); |
7f2cb270 KR |
503 | char *app_push PARAMS ((void)); |
504 | char *atof_ieee PARAMS ((char *str, int what_kind, LITTLENUM_TYPE * words)); | |
505 | char *input_scrub_include_file PARAMS ((char *filename, char *position)); | |
506 | char *input_scrub_new_file PARAMS ((char *filename)); | |
507 | char *input_scrub_next_buffer PARAMS ((char **bufp)); | |
a193acc0 ILT |
508 | PTR xmalloc PARAMS ((unsigned long size)); |
509 | PTR xrealloc PARAMS ((PTR ptr, unsigned long n)); | |
604633ae | 510 | int do_scrub_next_char PARAMS ((int (*get) (void), void (*unget) (int))); |
7f2cb270 KR |
511 | int gen_to_words PARAMS ((LITTLENUM_TYPE * words, int precision, |
512 | long exponent_bits)); | |
513 | int had_err PARAMS ((void)); | |
7f2cb270 KR |
514 | int ignore_input PARAMS ((void)); |
515 | int scrub_from_file PARAMS ((void)); | |
7f2cb270 KR |
516 | int scrub_from_string PARAMS ((void)); |
517 | int seen_at_least_1_file PARAMS ((void)); | |
518 | void app_pop PARAMS ((char *arg)); | |
519 | void as_howmuch PARAMS ((FILE * stream)); | |
a193acc0 | 520 | void as_perror PARAMS ((const char *gripe, const char *filename)); |
7f955c18 | 521 | void as_where PARAMS ((char **namep, unsigned int *linep)); |
7f2cb270 KR |
522 | void bump_line_counters PARAMS ((void)); |
523 | void do_scrub_begin PARAMS ((void)); | |
524 | void input_scrub_begin PARAMS ((void)); | |
525 | void input_scrub_close PARAMS ((void)); | |
526 | void input_scrub_end PARAMS ((void)); | |
7f2cb270 KR |
527 | void new_logical_line PARAMS ((char *fname, int line_number)); |
528 | void scrub_to_file PARAMS ((int ch)); | |
529 | void scrub_to_string PARAMS ((int ch)); | |
68878ef1 | 530 | void subsegs_begin PARAMS ((void)); |
7f2cb270 | 531 | void subseg_change PARAMS ((segT seg, int subseg)); |
b17c891e | 532 | segT subseg_new PARAMS ((const char *name, subsegT subseg)); |
e7501ac7 | 533 | segT subseg_force_new PARAMS ((const char *name, subsegT subseg)); |
68878ef1 | 534 | void subseg_set PARAMS ((segT seg, subsegT subseg)); |
a193acc0 ILT |
535 | #ifdef BFD_ASSEMBLER |
536 | segT subseg_get PARAMS ((const char *, int)); | |
537 | #endif | |
fecd2382 | 538 | |
7f955c18 KR |
539 | struct expressionS; |
540 | struct fix; | |
541 | struct symbol; | |
542 | ||
543 | #ifdef BFD_ASSEMBLER | |
544 | /* literal.c */ | |
545 | valueT add_to_literal_pool PARAMS ((struct symbol *, valueT, segT, int)); | |
546 | #endif | |
547 | ||
b11fb939 KR |
548 | #include "expr.h" /* Before targ-*.h */ |
549 | ||
a39116f1 | 550 | /* this one starts the chain of target dependant headers */ |
fecd2382 RP |
551 | #include "targ-env.h" |
552 | ||
fecd2382 | 553 | #include "struc-symbol.h" |
fecd2382 | 554 | #include "write.h" |
fecd2382 RP |
555 | #include "frags.h" |
556 | #include "hash.h" | |
557 | #include "read.h" | |
558 | #include "symbols.h" | |
559 | ||
560 | #include "tc.h" | |
561 | #include "obj.h" | |
562 | ||
c593cf41 SC |
563 | #include "listing.h" |
564 | ||
b17c891e KR |
565 | #ifdef BFD_ASSEMBLER |
566 | /* Someday perhaps this will be selectable at run-time. */ | |
567 | #if defined (OBJ_AOUT) || defined (OBJ_BOUT) | |
568 | #define OUTPUT_FLAVOR bfd_target_aout_flavour | |
569 | #endif | |
570 | #ifdef OBJ_COFF | |
571 | #define OUTPUT_FLAVOR bfd_target_coff_flavour | |
572 | #endif | |
573 | #ifdef OBJ_ECOFF | |
574 | #define OUTPUT_FLAVOR bfd_target_ecoff_flavour | |
575 | #endif | |
576 | #ifdef OBJ_ELF | |
577 | #define OUTPUT_FLAVOR bfd_target_elf_flavour | |
578 | #endif | |
579 | #endif /* BFD_ASSEMBLER */ | |
580 | ||
7f955c18 KR |
581 | #endif /* GAS */ |
582 | ||
a39116f1 | 583 | /* end of as.h */ |