160484Sobrien/* Multiple object format emulation.
2218822Sdim   Copyright 1995, 1996, 1997, 1999, 2000, 2002, 2004
360484Sobrien   Free Software Foundation, Inc.
433965Sjdp
560484Sobrien   This file is part of GAS, the GNU Assembler.
660484Sobrien
760484Sobrien   GAS is free software; you can redistribute it and/or modify
860484Sobrien   it under the terms of the GNU General Public License as published by
977298Sobrien   the Free Software Foundation; either version 2, or (at your option)
1060484Sobrien   any later version.
1160484Sobrien
1260484Sobrien   GAS is distributed in the hope that it will be useful,
1360484Sobrien   but WITHOUT ANY WARRANTY; without even the implied warranty of
1460484Sobrien   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1560484Sobrien   GNU General Public License for more details.
1660484Sobrien
1760484Sobrien   You should have received a copy of the GNU General Public License
1860484Sobrien   along with GAS; see the file COPYING.  If not, write to the Free
19218822Sdim   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
20218822Sdim   02110-1301, USA.  */
2160484Sobrien
2260484Sobrien#ifndef _OBJ_MULTI_H
2360484Sobrien#define _OBJ_MULTI_H
2460484Sobrien
2560484Sobrien#ifdef OBJ_HEADER
2660484Sobrien#include OBJ_HEADER
2760484Sobrien#else
2860484Sobrien
2933965Sjdp#include "emul.h"
3033965Sjdp#include "targ-cpu.h"
3133965Sjdp
3260484Sobrien#define OUTPUT_FLAVOR					\
3360484Sobrien	(this_format->flavor)
3433965Sjdp
3577298Sobrien#define obj_begin()					\
3677298Sobrien	(this_format->begin				\
3777298Sobrien	 ? (*this_format->begin) ()			\
3877298Sobrien	 : (void) 0)
3977298Sobrien
40218822Sdim#define obj_app_file(NAME, APPFILE)			\
4177298Sobrien	(this_format->app_file				\
42218822Sdim	 ? (*this_format->app_file) (NAME, APPFILE)	\
4377298Sobrien	 : (void) 0)
4477298Sobrien
4560484Sobrien#define obj_frob_symbol(S,P)				\
4660484Sobrien	(*this_format->frob_symbol) (S, &(P))
4733965Sjdp
4860484Sobrien#define obj_frob_file()					\
4960484Sobrien	(this_format->frob_file				\
5060484Sobrien	 ? (*this_format->frob_file) ()			\
5160484Sobrien	 : (void) 0)
5260484Sobrien
5377298Sobrien#define obj_frob_file_before_adjust()			\
5477298Sobrien	(this_format->frob_file_before_adjust		\
5577298Sobrien	 ? (*this_format->frob_file_before_adjust) ()	\
5677298Sobrien	 : (void) 0)
5777298Sobrien
58130561Sobrien#define obj_frob_file_before_fix()			\
59130561Sobrien	(this_format->frob_file_before_fix		\
60130561Sobrien	 ? (*this_format->frob_file_before_fix) ()	\
61130561Sobrien	 : (void) 0)
62130561Sobrien
6360484Sobrien#define obj_frob_file_after_relocs()			\
6460484Sobrien	(this_format->frob_file_after_relocs		\
6560484Sobrien	 ? (*this_format->frob_file_after_relocs) ()	\
6660484Sobrien	 : (void) 0)
6760484Sobrien
6860484Sobrien#define obj_ecoff_set_ext				\
6960484Sobrien	(*this_format->ecoff_set_ext)
7060484Sobrien
7160484Sobrien#define obj_pop_insert					\
7260484Sobrien	(*this_format->pop_insert)
7360484Sobrien
7460484Sobrien#define obj_read_begin_hook()				\
7560484Sobrien	(this_format->read_begin_hook			\
7660484Sobrien	 ? (*this_format->read_begin_hook) ()		\
7760484Sobrien	 : (void) 0)
7860484Sobrien
7960484Sobrien#define obj_symbol_new_hook(S)				\
8060484Sobrien	(this_format->symbol_new_hook			\
8160484Sobrien	 ? (*this_format->symbol_new_hook) (S)		\
8260484Sobrien	 : (void) 0)
8360484Sobrien
8460484Sobrien#define obj_sec_sym_ok_for_reloc(A)			\
8560484Sobrien	(this_format->sec_sym_ok_for_reloc		\
8660484Sobrien	 ? (*this_format->sec_sym_ok_for_reloc) (A)	\
8760484Sobrien	 : 0)
8860484Sobrien
8960484Sobrien#define S_GET_SIZE					\
9060484Sobrien	(*this_format->s_get_size)
9160484Sobrien
9277298Sobrien#define S_SET_SIZE(S, N)				\
9377298Sobrien	(this_format->s_set_size			\
9477298Sobrien	 ? (*this_format->s_set_size) (S, N)		\
9577298Sobrien	 : (void) 0)
9660484Sobrien
9760484Sobrien#define S_GET_ALIGN					\
9860484Sobrien	(*this_format->s_get_align)
9960484Sobrien
10077298Sobrien#define S_SET_ALIGN(S, N)				\
10177298Sobrien	(this_format->s_set_align			\
10277298Sobrien	 ? (*this_format->s_set_align) (S, N)		\
10377298Sobrien	 : (void) 0)
10460484Sobrien
10560484Sobrien#define S_GET_OTHER					\
10660484Sobrien	(*this_format->s_get_other)
10760484Sobrien
10877298Sobrien#define S_SET_OTHER(S, O)				\
10977298Sobrien	(this_format->s_set_other			\
11077298Sobrien	 ? (*this_format->s_set_other) (S, O)		\
11177298Sobrien	 : (void) 0)
11277298Sobrien
11360484Sobrien#define S_GET_DESC					\
11460484Sobrien	(*this_format->s_get_desc)
11560484Sobrien
11677298Sobrien#define S_SET_DESC(S, D)				\
11777298Sobrien	(this_format->s_set_desc			\
11877298Sobrien	 ? (*this_format->s_set_desc) (S, D)		\
11977298Sobrien	 : (void) 0)
12077298Sobrien
12177298Sobrien#define S_GET_TYPE					\
12277298Sobrien	(*this_format->s_get_desc)
12377298Sobrien
12477298Sobrien#define S_SET_TYPE(S, T)				\
12577298Sobrien	(this_format->s_set_type			\
12677298Sobrien	 ? (*this_format->s_set_type) (S, T)		\
12777298Sobrien	 : (void) 0)
12877298Sobrien
12960484Sobrien#define OBJ_COPY_SYMBOL_ATTRIBUTES(d,s)			\
13060484Sobrien	(this_format->copy_symbol_attributes		\
13160484Sobrien	 ? (*this_format->copy_symbol_attributes) (d, s) \
13260484Sobrien	 : (void) 0)
13360484Sobrien
13460484Sobrien#define OBJ_PROCESS_STAB(SEG,W,S,T,O,D)			\
13560484Sobrien	(this_format->process_stab			\
13660484Sobrien	 ? (*this_format->process_stab) (SEG,W,S,T,O,D)	\
13760484Sobrien	 : (void) 0)
13860484Sobrien
13977298Sobrien#define SEPARATE_STAB_SECTIONS \
14077298Sobrien	((*this_format->separate_stab_sections) ())
14177298Sobrien
14277298Sobrien#define INIT_STAB_SECTION(S)				\
14377298Sobrien	(this_format->init_stab_section			\
14477298Sobrien	 ? (*this_format->init_stab_section) (S)	\
14577298Sobrien	 : (void) 0)
14677298Sobrien
14777298Sobrien#define EMIT_SECTION_SYMBOLS (this_format->emit_section_symbols)
14877298Sobrien
149218822Sdim#define FAKE_LABEL_NAME (this_emulation->fake_label_name)
150218822Sdim
15133965Sjdp#ifdef OBJ_MAYBE_ELF
15260484Sobrien/* We need OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined in symbol.c
15360484Sobrien   We also need various STAB defines for stab.c  */
15460484Sobrien#include "obj-elf.h"
15533965Sjdp#endif
15633965Sjdp
15777298Sobrien#ifdef OBJ_MAYBE_AOUT
15877298Sobrien/* We want aout_process_stab in stabs.c for the aout table.  Defining this
15977298Sobrien   macro will have no other effect.  */
16077298Sobrien#define AOUT_STABS
16177298Sobrien#endif
16277298Sobrien
16360484Sobrien#endif /* !OBJ_HEADER */
16460484Sobrien#endif /* _OBJ_MULTI_H */
165