Commit | Line | Data |
---|---|---|
4c63da97 AM |
1 | /* Multiple object format emulation. |
2 | Copyright (C) 1995, 96, 97, 99, 2000 | |
3 | Free Software Foundation, Inc. | |
4 | ||
5 | This file is part of GAS, the GNU Assembler. | |
6 | ||
7 | GAS is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
5110c57e | 9 | the Free Software Foundation; either version 2, or (at your option) |
4c63da97 AM |
10 | any later version. |
11 | ||
12 | GAS is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with GAS; see the file COPYING. If not, write to the Free | |
19 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA | |
20 | 02111-1307, USA. */ | |
21 | ||
22 | #ifndef _OBJ_MULTI_H | |
23 | #define _OBJ_MULTI_H | |
24 | ||
25 | #ifdef OBJ_HEADER | |
26 | #include OBJ_HEADER | |
27 | #else | |
252b5132 RH |
28 | |
29 | #include "emul.h" | |
30 | #include "targ-cpu.h" | |
31 | ||
4ca72d38 AM |
32 | #define OUTPUT_FLAVOR \ |
33 | (this_format->flavor) | |
34 | ||
5110c57e HPN |
35 | #define obj_begin() \ |
36 | (this_format->begin \ | |
37 | ? (*this_format->begin) () \ | |
38 | : (void) 0) | |
39 | ||
40 | #define obj_app_file(NAME) \ | |
41 | (this_format->app_file \ | |
42 | ? (*this_format->app_file) (NAME) \ | |
43 | : (void) 0) | |
44 | ||
4ca72d38 | 45 | #define obj_frob_symbol(S,P) \ |
4c63da97 | 46 | (*this_format->frob_symbol) (S, &(P)) |
4ca72d38 AM |
47 | |
48 | #define obj_frob_file() \ | |
49 | (this_format->frob_file \ | |
4c63da97 | 50 | ? (*this_format->frob_file) () \ |
4ca72d38 AM |
51 | : (void) 0) |
52 | ||
4c63da97 AM |
53 | #define obj_frob_file_after_relocs() \ |
54 | (this_format->frob_file_after_relocs \ | |
55 | ? (*this_format->frob_file_after_relocs) () \ | |
56 | : (void) 0) | |
4ca72d38 AM |
57 | |
58 | #define obj_ecoff_set_ext \ | |
4c63da97 | 59 | (*this_format->ecoff_set_ext) |
4ca72d38 AM |
60 | |
61 | #define obj_pop_insert \ | |
4c63da97 | 62 | (*this_format->pop_insert) |
4ca72d38 AM |
63 | |
64 | #define obj_read_begin_hook() \ | |
65 | (this_format->read_begin_hook \ | |
4c63da97 | 66 | ? (*this_format->read_begin_hook) () \ |
4ca72d38 AM |
67 | : (void) 0) |
68 | ||
4c63da97 AM |
69 | #define obj_symbol_new_hook(S) \ |
70 | (this_format->symbol_new_hook \ | |
71 | ? (*this_format->symbol_new_hook) (S) \ | |
72 | : (void) 0) | |
4ca72d38 | 73 | |
4c63da97 AM |
74 | #define obj_sec_sym_ok_for_reloc(A) \ |
75 | (this_format->sec_sym_ok_for_reloc \ | |
76 | ? (*this_format->sec_sym_ok_for_reloc) (A) \ | |
77 | : 0) | |
4ca72d38 AM |
78 | |
79 | #define S_GET_SIZE \ | |
4c63da97 | 80 | (*this_format->s_get_size) |
4ca72d38 | 81 | |
5110c57e HPN |
82 | #define S_SET_SIZE(S, N) \ |
83 | (this_format->s_set_size \ | |
84 | ? (*this_format->s_set_size) (S, N) \ | |
85 | : (void) 0) | |
4ca72d38 AM |
86 | |
87 | #define S_GET_ALIGN \ | |
4c63da97 | 88 | (*this_format->s_get_align) |
4ca72d38 | 89 | |
5110c57e HPN |
90 | #define S_SET_ALIGN(S, N) \ |
91 | (this_format->s_set_align \ | |
92 | ? (*this_format->s_set_align) (S, N) \ | |
93 | : (void) 0) | |
4c63da97 AM |
94 | |
95 | #define S_GET_OTHER \ | |
96 | (*this_format->s_get_other) | |
97 | ||
5110c57e HPN |
98 | #define S_SET_OTHER(S, O) \ |
99 | (this_format->s_set_other \ | |
100 | ? (*this_format->s_set_other) (S, O) \ | |
101 | : (void) 0) | |
102 | ||
4c63da97 AM |
103 | #define S_GET_DESC \ |
104 | (*this_format->s_get_desc) | |
4ca72d38 | 105 | |
5110c57e HPN |
106 | #define S_SET_DESC(S, D) \ |
107 | (this_format->s_set_desc \ | |
108 | ? (*this_format->s_set_desc) (S, D) \ | |
109 | : (void) 0) | |
110 | ||
111 | #define S_GET_TYPE \ | |
112 | (*this_format->s_get_desc) | |
113 | ||
114 | #define S_SET_TYPE(S, T) \ | |
115 | (this_format->s_set_type \ | |
116 | ? (*this_format->s_set_type) (S, T) \ | |
117 | : (void) 0) | |
118 | ||
4ca72d38 AM |
119 | #define OBJ_COPY_SYMBOL_ATTRIBUTES(d,s) \ |
120 | (this_format->copy_symbol_attributes \ | |
4c63da97 | 121 | ? (*this_format->copy_symbol_attributes) (d, s) \ |
4ca72d38 AM |
122 | : (void) 0) |
123 | ||
124 | #define OBJ_PROCESS_STAB(SEG,W,S,T,O,D) \ | |
125 | (this_format->process_stab \ | |
4c63da97 | 126 | ? (*this_format->process_stab) (SEG,W,S,T,O,D) \ |
4ca72d38 | 127 | : (void) 0) |
252b5132 | 128 | |
5110c57e HPN |
129 | #define SEPARATE_STAB_SECTIONS \ |
130 | ((*this_format->separate_stab_sections) ()) | |
131 | ||
132 | #define INIT_STAB_SECTION(S) \ | |
133 | (this_format->init_stab_section \ | |
134 | ? (*this_format->init_stab_section) (S) \ | |
135 | : (void) 0) | |
136 | ||
137 | #define EMIT_SECTION_SYMBOLS (this_format->emit_section_symbols) | |
138 | ||
252b5132 | 139 | #ifdef OBJ_MAYBE_ELF |
4c63da97 AM |
140 | /* We need OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined in symbol.c |
141 | We also need various STAB defines for stab.c */ | |
4ca72d38 | 142 | #include "obj-elf.h" |
252b5132 | 143 | #endif |
4c63da97 | 144 | |
5110c57e HPN |
145 | #ifdef OBJ_MAYBE_AOUT |
146 | /* We want aout_process_stab in stabs.c for the aout table. Defining this | |
147 | macro will have no other effect. */ | |
148 | #define AOUT_STABS | |
149 | #endif | |
150 | ||
4c63da97 AM |
151 | #endif /* !OBJ_HEADER */ |
152 | #endif /* _OBJ_MULTI_H */ |