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