diff options
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/e-i386aout.c | 17 | ||||
-rw-r--r-- | gas/config/obj-aout.c | 85 | ||||
-rw-r--r-- | gas/config/obj-aout.h | 9 | ||||
-rw-r--r-- | gas/config/obj-coff.c | 56 | ||||
-rw-r--r-- | gas/config/obj-coff.h | 8 | ||||
-rw-r--r-- | gas/config/obj-ecoff.c | 19 | ||||
-rw-r--r-- | gas/config/obj-elf.c | 31 | ||||
-rw-r--r-- | gas/config/obj-elf.h | 26 | ||||
-rw-r--r-- | gas/config/obj-multi.h | 84 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 67 | ||||
-rw-r--r-- | gas/config/tc-i386.h | 31 | ||||
-rw-r--r-- | gas/config/te-multi.h | 22 |
12 files changed, 303 insertions, 152 deletions
diff --git a/gas/config/e-i386aout.c b/gas/config/e-i386aout.c new file mode 100644 index 00000000000..18fdf689c73 --- /dev/null +++ b/gas/config/e-i386aout.c @@ -0,0 +1,17 @@ +#include "as.h" +#include "emul.h" + +static const char * +i386aout_bfd_name () +{ + abort (); + return NULL; +} + +#define emul_bfd_name i386aout_bfd_name +#define emul_format &aout_format_ops + +#define emul_name "i386aout" +#define emul_struct_name i386aout +#define emul_default_endian 0 +#include "emul-target.h" diff --git a/gas/config/obj-aout.c b/gas/config/obj-aout.c index 4b4f4d80eb3..eabbe924e6c 100644 --- a/gas/config/obj-aout.c +++ b/gas/config/obj-aout.c @@ -1,5 +1,5 @@ /* a.out object file format - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,6 +19,8 @@ along with GAS; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define OBJ_HEADER "obj-aout.h" + #include "as.h" #ifdef BFD_ASSEMBLER #undef NO_RELOC @@ -67,7 +69,7 @@ static void obj_aout_line PARAMS ((int)); static void obj_aout_weak PARAMS ((int)); static void obj_aout_type PARAMS ((int)); -const pseudo_typeS obj_pseudo_table[] = +const pseudo_typeS aout_pseudo_table[] = { {"line", obj_aout_line, 0}, /* source code line number */ {"ln", obj_aout_line, 0}, /* coff line number that we use anyway */ @@ -94,8 +96,8 @@ const pseudo_typeS obj_pseudo_table[] = /* other stuff */ {"ABORT", s_abort, 0}, - {NULL} /* end sentinel */ -}; /* obj_pseudo_table */ + {NULL, NULL, 0} /* end sentinel */ +}; /* aout_pseudo_table */ #ifdef BFD_ASSEMBLER @@ -110,9 +112,9 @@ obj_aout_frob_symbol (sym, punt) int desc, type, other; flags = symbol_get_bfdsym (sym)->flags; - desc = S_GET_DESC (sym); - type = S_GET_TYPE (sym); - other = S_GET_OTHER (sym); + desc = aout_symbol (symbol_get_bfdsym (sym))->desc; + type = aout_symbol (symbol_get_bfdsym (sym))->type; + other = aout_symbol (symbol_get_bfdsym (sym))->other; sec = S_GET_SEGMENT (sym); /* Only frob simple symbols this way right now. */ @@ -187,7 +189,7 @@ obj_aout_frob_symbol (sym, punt) symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING; } - S_SET_TYPE (sym, type); + aout_symbol (symbol_get_bfdsym (sym))->type = type; /* Double check weak symbols. */ if (S_IS_WEAK (sym)) @@ -420,9 +422,17 @@ obj_aout_type (ignore) { ++input_line_pointer; if (strncmp (input_line_pointer, "object", 6) == 0) +#ifdef BFD_ASSEMBLER + aout_symbol (symbol_get_bfdsym (sym))->other = 1; +#else S_SET_OTHER (sym, 1); +#endif else if (strncmp (input_line_pointer, "function", 8) == 0) +#ifdef BFD_ASSEMBLER + aout_symbol (symbol_get_bfdsym (sym))->other = 2; +#else S_SET_OTHER (sym, 2); +#endif } } } @@ -431,11 +441,6 @@ obj_aout_type (ignore) s_ignore (0); } -void -obj_read_begin_hook () -{ -} - #ifndef BFD_ASSEMBLER void @@ -630,4 +635,58 @@ DEFUN_VOID (s_sect) #endif /* ! BFD_ASSEMBLER */ +#ifdef BFD_ASSEMBLER + +/* Support for an AOUT emulation. */ + +static void aout_pop_insert PARAMS ((void)); +static int obj_aout_s_get_other PARAMS ((symbolS *)); +static int obj_aout_s_get_desc PARAMS ((symbolS *)); + +static void +aout_pop_insert () +{ + pop_insert (aout_pseudo_table); +} + +static int +obj_aout_s_get_other (sym) + symbolS *sym; +{ + return aout_symbol (symbol_get_bfdsym (sym))->other; +} + +static int +obj_aout_s_get_desc (sym) + symbolS *sym; +{ + return aout_symbol (symbol_get_bfdsym (sym))->desc; +} + + +const struct format_ops aout_format_ops = +{ + bfd_target_aout_flavour, + 1, /* dfl_leading_underscore */ + 0, /* emit_section_symbols */ + obj_aout_frob_symbol, + obj_aout_frob_file, + 0, /* frob_file_after_relocs */ + 0, /* s_get_size */ + 0, /* s_set_size */ + 0, /* s_get_align */ + 0, /* s_set_align */ + obj_aout_s_get_other, + obj_aout_s_get_desc, + 0, /* copy_symbol_attributes */ + 0, /* generate_asm_lineno */ + 0, /* process_stab */ + 0, /* sec_sym_ok_for_reloc */ + aout_pop_insert, + 0, /* ecoff_set_ext */ + 0, /* read_begin_hook */ + 0 /* symbol_new_hook */ +}; +#endif BFD_ASSEMBLER + /* end of obj-aout.c */ diff --git a/gas/config/obj-aout.h b/gas/config/obj-aout.h index 2cf33fd1bc2..d08302a49bf 100644 --- a/gas/config/obj-aout.h +++ b/gas/config/obj-aout.h @@ -1,5 +1,5 @@ /* obj-aout.h, a.out object file format for gas, the assembler. - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 98, 1999 + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -51,6 +51,12 @@ extern const segT N_TYPE_seg[]; #endif /* ! BFD_ASSEMBLER */ +extern const pseudo_typeS aout_pseudo_table[]; + +#ifndef obj_pop_insert +#define obj_pop_insert() pop_insert (aout_pseudo_table) +#endif + /* SYMBOL TABLE */ /* Symbol table entry data type */ @@ -236,6 +242,7 @@ void tc_aout_fix_to_chars PARAMS ((char *where, struct fix *fixP, relax_addressT #endif +#define obj_read_begin_hook() {;} #define obj_symbol_new_hook(s) {;} #define EMIT_SECTION_SYMBOLS 0 diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index 3bdc73ce96c..eceda5a1b8e 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -4527,7 +4527,7 @@ adjust_stab_section(abfd, seg) #endif /* not BFD_ASSEMBLER */ -const pseudo_typeS obj_pseudo_table[] = +const pseudo_typeS coff_pseudo_table[] = { {"def", obj_coff_def, 0}, {"dim", obj_coff_dim, 0}, @@ -4568,58 +4568,42 @@ const pseudo_typeS obj_pseudo_table[] = {"sdef", obj_coff_def, 0}, #endif {NULL, NULL, 0} /* end sentinel */ -}; /* obj_pseudo_table */ +}; /* coff_pseudo_table */ #ifdef BFD_ASSEMBLER -static void coff_pop_insert PARAMS ((void)); -static int coff_sec_sym_ok_for_reloc PARAMS ((asection *)); - /* Support for a COFF emulation. */ +static void coff_pop_insert PARAMS ((void)); + static void coff_pop_insert () { - pop_insert (obj_pseudo_table); -} - -static int -coff_sec_sym_ok_for_reloc (sec) - asection *sec ATTRIBUTE_UNUSED; -{ - return 0; + pop_insert (coff_pseudo_table); } const struct format_ops coff_format_ops = { bfd_target_coff_flavour, - 0, - 1, + 0, /* dfl_leading_underscore */ + 1, /* emit_section_symbols */ coff_frob_symbol, - 0, + 0, /* frob_file */ coff_frob_file_after_relocs, - 0, 0, - 0, 0, - 0, -#if 0 - obj_generate_asm_lineno, -#else - 0, -#endif -#if 0 - obj_stab, -#else - 0, -#endif - coff_sec_sym_ok_for_reloc, + 0, /* s_get_size */ + 0, /* s_set_size */ + 0, /* s_get_align */ + 0, /* s_set_align */ + 0, /* s_get_other */ + 0, /* s_get_desc */ + 0, /* copy_symbol_attributes */ + 0, /* generate_asm_lineno */ + 0, /* process_stab */ + 0, /* sec_sym_ok_for_reloc */ coff_pop_insert, -#if 0 - obj_set_ext, -#else - 0, -#endif + 0, /* ecoff_set_ext */ coff_obj_read_begin_hook, - coff_obj_symbol_new_hook, + coff_obj_symbol_new_hook }; #endif diff --git a/gas/config/obj-coff.h b/gas/config/obj-coff.h index 16d7986ecc9..5e7642bcf5c 100644 --- a/gas/config/obj-coff.h +++ b/gas/config/obj-coff.h @@ -1,5 +1,5 @@ /* coff object file format - Copyright (C) 1989, 90, 91, 92, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1989, 90, 91, 92, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS. @@ -821,6 +821,12 @@ extern void obj_coff_pe_handle_link_once (); #endif /* not BFD_ASSEMBLER */ +extern const pseudo_typeS coff_pseudo_table[]; + +#ifndef obj_pop_insert +#define obj_pop_insert() pop_insert (coff_pseudo_table) +#endif + /* In COFF, if a symbol is defined using .def/.val SYM/.endef, it's OK to redefine the symbol later on. This can happen if C symbols use a prefix, and a symbol is defined both with and without the prefix, diff --git a/gas/config/obj-ecoff.c b/gas/config/obj-ecoff.c index 64892431ad7..767dc588c82 100644 --- a/gas/config/obj-ecoff.c +++ b/gas/config/obj-ecoff.c @@ -1,5 +1,6 @@ /* ECOFF object file format. - Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright (C) 1993, 94, 95, 96, 97, 98, 99, 2000 + Free Software Foundation, Inc. Contributed by Cygnus Support. This file was put together by Ian Lance Taylor <ian@cygnus.com>. @@ -292,14 +293,18 @@ ecoff_pop_insert () const struct format_ops ecoff_format_ops = { bfd_target_ecoff_flavour, - 0, - 1, + 0, /* dfl_leading_underscore */ + 1, /* emit_section_symbols */ obj_ecoff_frob_symbol, ecoff_frob_file, - 0, - 0, 0, - 0, 0, - 0, + 0, /* frob_file_after_relocs */ + 0, /* s_get_size */ + 0, /* s_set_size */ + 0, /* s_get_align */ + 0, /* s_set_align */ + 0, /* s_get_other */ + 0, /* s_get_desc */ + 0, /* copy_symbol_attributes */ ecoff_generate_asm_lineno, ecoff_stab, ecoff_sec_sym_ok_for_reloc, diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 4fbd8bc6408..427f5b044fd 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -1,5 +1,5 @@ /* ELF object file format - Copyright (C) 1992, 93-98, 1999 Free Software Foundation, Inc. + Copyright (C) 1992, 93-99, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -221,6 +221,13 @@ elf_s_set_align (sym, align) S_SET_ALIGN (sym, align); } +int +elf_s_get_other (sym) + symbolS *sym; +{ + return elf_symbol (symbol_get_bfdsym (sym))->internal_elf_sym.st_other; +} + static void elf_copy_symbol_attributes (dest, src) symbolS *dest, *src; @@ -719,7 +726,7 @@ obj_elf_parse_section_letters (str, len) else #endif { - as_warn (bad_msg); + as_warn ("%s", bad_msg); attr = -1; } } @@ -1221,7 +1228,7 @@ obj_elf_vtable_entry (ignore) } void -obj_read_begin_hook () +elf_obj_read_begin_hook () { #ifdef NEED_ECOFF_DEBUG if (ECOFF_DEBUGGING) @@ -1230,7 +1237,7 @@ obj_read_begin_hook () } void -obj_symbol_new_hook (symbolP) +elf_obj_symbol_new_hook (symbolP) symbolS *symbolP; { struct elf_obj_sy *sy_obj; @@ -1877,28 +1884,30 @@ sco_id () const struct format_ops elf_format_ops = { bfd_target_elf_flavour, - 0, - 1, + 0, /* dfl_leading_underscore */ + 1, /* emit_section_symbols */ elf_frob_symbol, elf_frob_file, elf_frob_file_after_relocs, elf_s_get_size, elf_s_set_size, elf_s_get_align, elf_s_set_align, + elf_s_get_other, + 0, /* s_get_desc */ elf_copy_symbol_attributes, #ifdef NEED_ECOFF_DEBUG ecoff_generate_asm_lineno, ecoff_stab, #else - 0, - 0, /* process_stab */ + 0, /* generate_asm_lineno */ + 0, /* process_stab */ #endif elf_sec_sym_ok_for_reloc, elf_pop_insert, #ifdef NEED_ECOFF_DEBUG elf_ecoff_set_ext, #else - 0, + 0, /* ecoff_set_ext */ #endif - obj_read_begin_hook, - obj_symbol_new_hook, + elf_obj_read_begin_hook, + elf_obj_symbol_new_hook, }; diff --git a/gas/config/obj-elf.h b/gas/config/obj-elf.h index 0d16ca2a641..722c5fdf94d 100644 --- a/gas/config/obj-elf.h +++ b/gas/config/obj-elf.h @@ -1,5 +1,5 @@ /* ELF object file format. - Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -53,6 +53,12 @@ extern int alpha_flag_mdebug; #endif /* MIPS_STABS_ELF */ #endif /* TC_MIPS */ +#ifdef OBJ_MAYBE_ECOFF +#ifndef ECOFF_DEBUGGING +#define ECOFF_DEBUGGING 1 +#endif +#endif + /* Additional information we keep for each symbol. */ struct elf_obj_sy { @@ -106,10 +112,14 @@ extern void elf_begin PARAMS ((void)); (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value = (V)) #endif -#define S_GET_OTHER(S) \ - (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_other) +int elf_s_get_other PARAMS ((symbolS *)); +#ifndef S_GET_OTHER +#define S_GET_OTHER(S) (elf_s_get_other (S)) +#endif +#ifndef S_SET_OTHER #define S_SET_OTHER(S,V) \ (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_other = (V)) +#endif extern asection *gdb_section; @@ -141,6 +151,16 @@ extern void obj_elf_text PARAMS ((int)); #define obj_sec_sym_ok_for_reloc(SEC) ((SEC)->owner != 0) #endif +void elf_obj_read_begin_hook PARAMS ((void)); +#ifndef obj_read_begin_hook +#define obj_read_begin_hook elf_obj_read_begin_hook +#endif + +void elf_obj_symbol_new_hook PARAMS ((symbolS *)); +#ifndef obj_symbol_new_hook +#define obj_symbol_new_hook elf_obj_symbol_new_hook +#endif + /* When setting one symbol equal to another, by default we probably want them to have the same "size", whatever it means in the current context. */ diff --git a/gas/config/obj-multi.h b/gas/config/obj-multi.h index 56e1f922ee0..42b7eb33e3c 100644 --- a/gas/config/obj-multi.h +++ b/gas/config/obj-multi.h @@ -1,4 +1,30 @@ -/* hi */ +/* Multiple object format emulation. + Copyright (C) 1995, 96, 97, 99, 2000 + Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#ifndef _OBJ_MULTI_H +#define _OBJ_MULTI_H + +#ifdef OBJ_HEADER +#include OBJ_HEADER +#else #include "emul.h" #include "targ-cpu.h" @@ -7,60 +33,72 @@ (this_format->flavor) #define obj_frob_symbol(S,P) \ - (this_format->frob_symbol) (S, &(P)) + (*this_format->frob_symbol) (S, &(P)) #define obj_frob_file() \ (this_format->frob_file \ - ? this_format->frob_file () \ + ? (*this_format->frob_file) () \ : (void) 0) -#define obj_frob_file_after_relocs \ - (this_format->frob_file_after_relocs) +#define obj_frob_file_after_relocs() \ + (this_format->frob_file_after_relocs \ + ? (*this_format->frob_file_after_relocs) () \ + : (void) 0) #define obj_ecoff_set_ext \ - (this_format->ecoff_set_ext) + (*this_format->ecoff_set_ext) #define obj_pop_insert \ - (this_format->pop_insert) + (*this_format->pop_insert) #define obj_read_begin_hook() \ (this_format->read_begin_hook \ - ? this_format->read_begin_hook () \ + ? (*this_format->read_begin_hook) () \ : (void) 0) -#define obj_symbol_new_hook \ - (this_format->symbol_new_hook) +#define obj_symbol_new_hook(S) \ + (this_format->symbol_new_hook \ + ? (*this_format->symbol_new_hook) (S) \ + : (void) 0) -#define obj_sec_sym_ok_for_reloc \ - (this_format->sec_sym_ok_for_reloc) +#define obj_sec_sym_ok_for_reloc(A) \ + (this_format->sec_sym_ok_for_reloc \ + ? (*this_format->sec_sym_ok_for_reloc) (A) \ + : 0) #define S_GET_SIZE \ - (this_format->s_get_size) + (*this_format->s_get_size) #define S_SET_SIZE \ - (this_format->s_set_size) + (*this_format->s_set_size) #define S_GET_ALIGN \ - (this_format->s_get_align) + (*this_format->s_get_align) #define S_SET_ALIGN \ - (this_format->s_set_align) + (*this_format->s_set_align) + +#define S_GET_OTHER \ + (*this_format->s_get_other) + +#define S_GET_DESC \ + (*this_format->s_get_desc) #define OBJ_COPY_SYMBOL_ATTRIBUTES(d,s) \ (this_format->copy_symbol_attributes \ - ? this_format->copy_symbol_attributes (d, s) \ + ? (*this_format->copy_symbol_attributes) (d, s) \ : (void) 0) #define OBJ_PROCESS_STAB(SEG,W,S,T,O,D) \ (this_format->process_stab \ - ? this_format->process_stab (SEG,W,S,T,O,D) \ + ? (*this_format->process_stab) (SEG,W,S,T,O,D) \ : (void) 0) -#if defined (OBJ_MAYBE_ECOFF) || (defined (OBJ_MAYBE_ELF) && defined (TC_MIPS)) -#define ECOFF_DEBUGGING 1 -#endif - #ifdef OBJ_MAYBE_ELF -/* We need obj-elf for OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined */ +/* We need OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined in symbol.c + We also need various STAB defines for stab.c */ #include "obj-elf.h" #endif + +#endif /* !OBJ_HEADER */ +#endif /* _OBJ_MULTI_H */ diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 943aea8113b..5e7bb781e8f 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1,5 +1,5 @@ /* i386.c -- Assemble code for the Intel 80386 - Copyright (C) 1989, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1989, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -2586,8 +2586,12 @@ i386_immediate (imm_start) break; } } -#ifdef OBJ_AOUT - else if (exp_seg != text_section +#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) + else if ( +#ifdef BFD_ASSEMBLER + OUTPUT_FLAVOR == bfd_target_aout_flavour && +#endif + exp_seg != text_section && exp_seg != data_section && exp_seg != bss_section && exp_seg != undefined_section @@ -2596,7 +2600,11 @@ i386_immediate (imm_start) #endif ) { +#ifdef BFD_ASSEMBLER + as_bad (_("Unimplemented segment %s in operand"), exp_seg->name); +#else as_bad (_("Unimplemented segment type %d in operand"), exp_seg); +#endif return 0; } #endif @@ -2821,13 +2829,21 @@ i386_displacement (disp_start, disp_end) if (fits_in_signed_byte (exp->X_add_number)) i.types[this_operand] |= Disp8; } -#ifdef OBJ_AOUT - else if (exp_seg != text_section +#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) + else if ( +#ifdef BFD_ASSEMBLER + OUTPUT_FLAVOR == bfd_target_aout_flavour && +#endif + exp_seg != text_section && exp_seg != data_section && exp_seg != bss_section && exp_seg != undefined_section) { - as_bad (_ ("Unimplemented segment type %d in operand"), exp_seg); +#ifdef BFD_ASSEMBLER + as_bad (_("Unimplemented segment %s in operand"), exp_seg->name); +#else + as_bad (_("Unimplemented segment type %d in operand"), exp_seg); +#endif return 0; } #endif @@ -4206,8 +4222,9 @@ md_show_usage (stream) } #ifdef BFD_ASSEMBLER -#ifdef OBJ_MAYBE_ELF -#ifdef OBJ_MAYBE_COFF +#if ((defined (OBJ_MAYBE_ELF) && defined (OBJ_MAYBE_COFF)) \ + || (defined (OBJ_MAYBE_ELF) && defined (OBJ_MAYBE_AOUT)) \ + || (defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT))) /* Pick the target format to use. */ @@ -4216,18 +4233,25 @@ i386_target_format () { switch (OUTPUT_FLAVOR) { +#ifdef OBJ_MAYBE_AOUT + case bfd_target_aout_flavour: + return AOUT_TARGET_FORMAT; +#endif +#ifdef OBJ_MAYBE_COFF case bfd_target_coff_flavour: return "coff-i386"; +#endif +#ifdef OBJ_MAYBE_ELF case bfd_target_elf_flavour: return "elf32-i386"; +#endif default: abort (); return NULL; } } -#endif /* OBJ_MAYBE_COFF */ -#endif /* OBJ_MAYBE_ELF */ +#endif /* OBJ_MAYBE_ more than one */ #endif /* BFD_ASSEMBLER */ symbolS * @@ -4257,17 +4281,20 @@ md_section_align (segment, size) segT segment ATTRIBUTE_UNUSED; valueT size; { -#ifdef OBJ_AOUT #ifdef BFD_ASSEMBLER - /* For a.out, force the section size to be aligned. If we don't do - this, BFD will align it for us, but it will not write out the - final bytes of the section. This may be a bug in BFD, but it is - easier to fix it here since that is how the other a.out targets - work. */ - int align; - - align = bfd_get_section_alignment (stdoutput, segment); - size = ((size + (1 << align) - 1) & ((valueT) -1 << align)); +#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) + if (OUTPUT_FLAVOR == bfd_target_aout_flavour) + { + /* For a.out, force the section size to be aligned. If we don't do + this, BFD will align it for us, but it will not write out the + final bytes of the section. This may be a bug in BFD, but it is + easier to fix it here since that is how the other a.out targets + work. */ + int align; + + align = bfd_get_section_alignment (stdoutput, segment); + size = ((size + (1 << align) - 1) & ((valueT) -1 << align)); + } #endif #endif diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h index f84b2f288aa..cf378e8e93a 100644 --- a/gas/config/tc-i386.h +++ b/gas/config/tc-i386.h @@ -1,5 +1,5 @@ /* tc-i386.h -- Header file for tc-i386.c - Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -74,35 +74,36 @@ extern int tc_i386_fix_adjustable PARAMS ((struct fix *)); #define TARGET_ARCH bfd_arch_i386 -#ifdef OBJ_AOUT #ifdef TE_NetBSD -#define TARGET_FORMAT "a.out-i386-netbsd" +#define AOUT_TARGET_FORMAT "a.out-i386-netbsd" #endif #ifdef TE_386BSD -#define TARGET_FORMAT "a.out-i386-bsd" +#define AOUT_TARGET_FORMAT "a.out-i386-bsd" #endif #ifdef TE_LINUX -#define TARGET_FORMAT "a.out-i386-linux" +#define AOUT_TARGET_FORMAT "a.out-i386-linux" #endif #ifdef TE_Mach -#define TARGET_FORMAT "a.out-mach3" +#define AOUT_TARGET_FORMAT "a.out-mach3" #endif #ifdef TE_DYNIX -#define TARGET_FORMAT "a.out-i386-dynix" +#define AOUT_TARGET_FORMAT "a.out-i386-dynix" #endif -#ifndef TARGET_FORMAT -#define TARGET_FORMAT "a.out-i386" +#ifndef AOUT_TARGET_FORMAT +#define AOUT_TARGET_FORMAT "a.out-i386" #endif -#endif /* OBJ_AOUT */ +#if ((defined (OBJ_MAYBE_ELF) && defined (OBJ_MAYBE_COFF)) \ + || (defined (OBJ_MAYBE_ELF) && defined (OBJ_MAYBE_AOUT)) \ + || (defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT))) +extern const char *i386_target_format PARAMS ((void)); +#define TARGET_FORMAT i386_target_format () +#else #ifdef OBJ_ELF #define TARGET_FORMAT "elf32-i386" #endif - -#ifdef OBJ_MAYBE_ELF -#ifdef OBJ_MAYBE_COFF -extern const char *i386_target_format PARAMS ((void)); -#define TARGET_FORMAT i386_target_format () +#ifdef OBJ_AOUT +#define TARGET_FORMAT AOUT_TARGET_FORMAT #endif #endif diff --git a/gas/config/te-multi.h b/gas/config/te-multi.h deleted file mode 100644 index b8eda4505fb..00000000000 --- a/gas/config/te-multi.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This file is te-generic.h and is intended to be a template for - * target environment specific header files. - * - * It is my intent that this file will evolve into a file suitable for config, - * compile, and copying as an aid for testing and porting. xoxorich. - */ - -/* Added these, because if we don't know what we're targetting we may - need an assembler version of libgcc, and that will use local - labels. */ -#define LOCAL_LABELS_DOLLAR 1 -#define LOCAL_LABELS_FB 1 - -/* these define interfaces */ -#ifdef OBJ_HEADER -#include OBJ_HEADER -#else -#include "obj-format.h" -#endif - -/* end of te-generic.h */ |