1 /* Multiple object format emulation. 2 Copyright (C) 1995-2025 Free Software Foundation, Inc. 3 4 This file is part of GAS, the GNU Assembler. 5 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 3, or (at your option) 9 any later version. 10 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. 15 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 the Free 18 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 19 02110-1301, USA. */ 20 21 #ifndef _OBJ_MULTI_H 22 #define _OBJ_MULTI_H 23 24 #ifdef OBJ_HEADER 25 #include OBJ_HEADER 26 #else 27 28 #include "emul.h" 29 #include "targ-cpu.h" 30 31 #define OUTPUT_FLAVOR \ 32 (this_format->flavor) 33 34 #define obj_begin() \ 35 (this_format->begin \ 36 ? (*this_format->begin) () \ 37 : (void) 0) 38 39 #define obj_end() \ 40 (this_format->end \ 41 ? (*this_format->end) () \ 42 : (void) 0) 43 44 #define obj_app_file(NAME) \ 45 (this_format->app_file \ 46 ? (*this_format->app_file) (NAME) \ 47 : (void) 0) 48 49 #define obj_assign_symbol(S) \ 50 (this_format->assign_symbol \ 51 ? (*this_format->assign_symbol) (S) \ 52 : (void) 0) 53 54 #define obj_frob_symbol(S,P) \ 55 (*this_format->frob_symbol) (S, &(P)) 56 57 #define obj_frob_file() \ 58 (this_format->frob_file \ 59 ? (*this_format->frob_file) () \ 60 : (void) 0) 61 62 #define obj_frob_file_before_adjust() \ 63 (this_format->frob_file_before_adjust \ 64 ? (*this_format->frob_file_before_adjust) () \ 65 : (void) 0) 66 67 #define obj_frob_file_before_fix() \ 68 (this_format->frob_file_before_fix \ 69 ? (*this_format->frob_file_before_fix) () \ 70 : (void) 0) 71 72 #define obj_frob_file_after_relocs() \ 73 (this_format->frob_file_after_relocs \ 74 ? (*this_format->frob_file_after_relocs) () \ 75 : (void) 0) 76 77 #define obj_ecoff_set_ext \ 78 (*this_format->ecoff_set_ext) 79 80 #define obj_pop_insert \ 81 (*this_format->pop_insert) 82 83 #define obj_read_begin_hook() \ 84 (this_format->read_begin_hook \ 85 ? (*this_format->read_begin_hook) () \ 86 : (void) 0) 87 88 #define obj_symbol_new_hook(S) \ 89 (this_format->symbol_new_hook \ 90 ? (*this_format->symbol_new_hook) (S) \ 91 : (void) 0) 92 93 #define obj_symbol_clone_hook(N, O) \ 94 (this_format->symbol_clone_hook \ 95 ? (*this_format->symbol_clone_hook) (N, O) \ 96 : (void) 0) 97 98 #define obj_sec_sym_ok_for_reloc(A) \ 99 (this_format->sec_sym_ok_for_reloc \ 100 ? (*this_format->sec_sym_ok_for_reloc) (A) \ 101 : 0) 102 103 #define obj_adjust_symtab() \ 104 (this_format->adjust_symtab \ 105 ? (*this_format->adjust_symtab) () \ 106 : (void) 0) 107 108 #define S_GET_SIZE \ 109 (*this_format->s_get_size) 110 111 #define S_SET_SIZE(S, N) \ 112 (this_format->s_set_size \ 113 ? (*this_format->s_set_size) (S, N) \ 114 : (void) 0) 115 116 #define S_GET_ALIGN \ 117 (*this_format->s_get_align) 118 119 #define S_SET_ALIGN(S, N) \ 120 (this_format->s_set_align \ 121 ? (*this_format->s_set_align) (S, N) \ 122 : (void) 0) 123 124 #define S_GET_OTHER \ 125 (*this_format->s_get_other) 126 127 #define S_SET_OTHER(S, O) \ 128 (this_format->s_set_other \ 129 ? (*this_format->s_set_other) (S, O) \ 130 : (void) 0) 131 132 #define S_GET_DESC \ 133 (*this_format->s_get_desc) 134 135 #define S_SET_DESC(S, D) \ 136 (this_format->s_set_desc \ 137 ? (*this_format->s_set_desc) (S, D) \ 138 : (void) 0) 139 140 #define S_GET_TYPE \ 141 (*this_format->s_get_desc) 142 143 #define S_SET_TYPE(S, T) \ 144 (this_format->s_set_type \ 145 ? (*this_format->s_set_type) (S, T) \ 146 : (void) 0) 147 148 #define OBJ_COPY_SYMBOL_ATTRIBUTES(d,s) \ 149 (this_format->copy_symbol_attributes \ 150 ? (*this_format->copy_symbol_attributes) (d, s) \ 151 : (void) 0) 152 153 #define OBJ_PROCESS_STAB(W,S,T,O,D) \ 154 (this_format->process_stab \ 155 ? (*this_format->process_stab) (W,S,T,O,D) \ 156 : (void) 0) 157 158 #define SEPARATE_STAB_SECTIONS \ 159 ((*this_format->separate_stab_sections) ()) 160 161 #define INIT_STAB_SECTION(STAB, STR) \ 162 (this_format->init_stab_section \ 163 ? (*this_format->init_stab_section) (STAB, STR) \ 164 : (void) 0) 165 166 #define EMIT_SECTION_SYMBOLS (this_format->emit_section_symbols) 167 168 #ifndef INITIALIZING_EMULS 169 /* We want to use the default FAKE_LABEL_NAME in as.c. */ 170 #define FAKE_LABEL_NAME (this_emulation->fake_label_name) 171 #endif 172 173 #ifdef OBJ_MAYBE_ELF 174 /* We need OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined in symbol.c 175 We also need various STAB defines for stab.c */ 176 #include "obj-elf.h" 177 #endif 178 179 #ifdef OBJ_MAYBE_AOUT 180 /* We want aout_process_stab in stabs.c for the aout table. Defining this 181 macro will have no other effect. */ 182 #define AOUT_STABS 183 #endif 184 185 #endif /* !OBJ_HEADER */ 186 #endif /* _OBJ_MULTI_H */ 187