diff options
author | Alan Modra <amodra@gmail.com> | 1999-09-02 15:12:01 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 1999-09-02 15:12:01 +0000 |
commit | 4ca72d382982b09b4a838e6170792d657cc707ff (patch) | |
tree | 7c989fb9562e1e88ae43671e9127ee7ee87b6242 /gas/config | |
parent | bcef92fa2302e7e7728bc92c28571672b6efd9c1 (diff) | |
download | gdb-4ca72d382982b09b4a838e6170792d657cc707ff.zip gdb-4ca72d382982b09b4a838e6170792d657cc707ff.tar.gz gdb-4ca72d382982b09b4a838e6170792d657cc707ff.tar.bz2 |
Enable --emulation={i386coff,i386elf} for i386 gas.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/obj-coff.c | 14 | ||||
-rw-r--r-- | gas/config/obj-elf.h | 26 | ||||
-rw-r--r-- | gas/config/obj-multi.h | 86 |
3 files changed, 79 insertions, 47 deletions
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index c5c2680..cd337ce 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -4445,19 +4445,13 @@ coff_sec_sym_ok_for_reloc (sec) return 0; } -static void -no_func () -{ - abort (); -} - const struct format_ops coff_format_ops = { bfd_target_coff_flavour, 0, 1, coff_frob_symbol, - no_func, + 0, coff_frob_file_after_relocs, 0, 0, 0, 0, @@ -4465,19 +4459,19 @@ const struct format_ops coff_format_ops = #if 0 obj_generate_asm_lineno, #else - no_func, + 0, #endif #if 0 obj_stab, #else - no_func, + 0, #endif coff_sec_sym_ok_for_reloc, coff_pop_insert, #if 0 obj_set_ext, #else - no_func, + 0, #endif coff_obj_read_begin_hook, coff_obj_symbol_new_hook, diff --git a/gas/config/obj-elf.h b/gas/config/obj-elf.h index d39998e..0d16ca2 100644 --- a/gas/config/obj-elf.h +++ b/gas/config/obj-elf.h @@ -28,7 +28,9 @@ #define OBJ_ELF 1 +#ifndef OUTPUT_FLAVOR #define OUTPUT_FLAVOR bfd_target_elf_flavour +#endif #include <bfd.h> @@ -52,10 +54,6 @@ extern int alpha_flag_mdebug; #endif /* TC_MIPS */ /* Additional information we keep for each symbol. */ - -/* FIXME: For some reason, this structure is needed both here and in - obj-multi.h. */ -#ifndef OBJ_SYMFIELD_TYPE struct elf_obj_sy { /* Whether the symbol has been marked as local. */ @@ -76,7 +74,6 @@ struct elf_obj_sy valueT ecoff_extern_size; #endif }; -#endif #define OBJ_SYMFIELD_TYPE struct elf_obj_sy @@ -91,15 +88,23 @@ extern void elf_begin PARAMS ((void)); /* should be conditional on address size! */ #define elf_symbol(asymbol) ((elf_symbol_type *)(&(asymbol)->the_bfd)) +#ifndef S_GET_SIZE #define S_GET_SIZE(S) \ (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_size) +#endif +#ifndef S_SET_SIZE #define S_SET_SIZE(S,V) \ (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_size = (V)) +#endif +#ifndef S_GET_ALIGN #define S_GET_ALIGN(S) \ (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value) +#endif +#ifndef S_SET_ALIGN #define S_SET_ALIGN(S,V) \ (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) @@ -108,10 +113,14 @@ extern void elf_begin PARAMS ((void)); extern asection *gdb_section; +#ifndef obj_frob_file #define obj_frob_file elf_frob_file +#endif extern void elf_frob_file PARAMS ((void)); +#ifndef obj_frob_file_after_relocs #define obj_frob_file_after_relocs elf_frob_file_after_relocs +#endif extern void elf_frob_file_after_relocs PARAMS ((void)); #define obj_app_file elf_file_symbol @@ -128,11 +137,14 @@ extern void obj_elf_text PARAMS ((int)); /* BFD wants to write the udata field, which is a no-no for the globally defined sections. */ +#ifndef obj_sec_sym_ok_for_reloc #define obj_sec_sym_ok_for_reloc(SEC) ((SEC)->owner != 0) +#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. */ +#ifndef OBJ_COPY_SYMBOL_ATTRIBUTES #define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST,SRC) \ do \ { \ @@ -155,6 +167,7 @@ do \ S_SET_OTHER ((DEST), S_GET_OTHER (SRC)); \ } \ while (0) +#endif /* Stabs go in a separate section. */ #define SEPARATE_STAB_SECTIONS 1 @@ -175,6 +188,7 @@ extern void obj_elf_init_stab_section PARAMS ((segT)); #define INIT_STAB_SECTION(seg) \ ((void)(ECOFF_DEBUGGING ? 0 : (obj_elf_init_stab_section (seg), 0))) +#undef OBJ_PROCESS_STAB #define OBJ_PROCESS_STAB(seg, what, string, type, other, desc) \ if (ECOFF_DEBUGGING) \ ecoff_stab ((seg), (what), (string), (type), (other), (desc)) @@ -186,7 +200,9 @@ extern void elf_frob_symbol PARAMS ((symbolS *, int *)); #endif extern void elf_pop_insert PARAMS ((void)); +#ifndef obj_pop_insert #define obj_pop_insert() elf_pop_insert() +#endif #ifndef OBJ_MAYBE_ELF #define obj_ecoff_set_ext elf_ecoff_set_ext diff --git a/gas/config/obj-multi.h b/gas/config/obj-multi.h index d54c61f..56e1f92 100644 --- a/gas/config/obj-multi.h +++ b/gas/config/obj-multi.h @@ -3,42 +3,64 @@ #include "emul.h" #include "targ-cpu.h" -#define OUTPUT_FLAVOR (this_format->flavor) -#define obj_frob_symbol(S,P) (this_format->frob_symbol)(S,&(P)) -#define obj_frob_file (this_format->frob_file) -#define obj_frob_file_after_relocs (this_format->frob_file_after_relocs) -#define obj_ecoff_set_ext (this_format->ecoff_set_ext) -#define obj_pop_insert (this_format->pop_insert) -#define obj_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_sec_sym_ok_for_reloc (this_format->sec_sym_ok_for_reloc) -#define S_GET_SIZE (this_format->s_get_size) -#define S_SET_SIZE (this_format->s_set_size) -#define S_GET_ALIGN (this_format->s_get_align) -#define S_SET_ALIGN (this_format->s_set_align) -#define OBJ_COPY_SYMBOL_ATTRIBUTES (this_format->copy_symbol_attributes) -#define OBJ_PROCESS_STAB (this_format->process_stab) +#define OUTPUT_FLAVOR \ + (this_format->flavor) + +#define obj_frob_symbol(S,P) \ + (this_format->frob_symbol) (S, &(P)) + +#define obj_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_ecoff_set_ext \ + (this_format->ecoff_set_ext) + +#define obj_pop_insert \ + (this_format->pop_insert) + +#define obj_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_sec_sym_ok_for_reloc \ + (this_format->sec_sym_ok_for_reloc) + +#define S_GET_SIZE \ + (this_format->s_get_size) + +#define S_SET_SIZE \ + (this_format->s_set_size) + +#define S_GET_ALIGN \ + (this_format->s_get_align) + +#define S_SET_ALIGN \ + (this_format->s_set_align) + +#define OBJ_COPY_SYMBOL_ATTRIBUTES(d,s) \ + (this_format->copy_symbol_attributes \ + ? 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) \ + : (void) 0) #if defined (OBJ_MAYBE_ECOFF) || (defined (OBJ_MAYBE_ELF) && defined (TC_MIPS)) #define ECOFF_DEBUGGING 1 #endif -/* FIXME: What's the story here? Why do we have to define - OBJ_SYMFIELD_TYPE both here and in obj-elf.h? */ - #ifdef OBJ_MAYBE_ELF -struct elf_obj_sy -{ - int local; - expressionS *size; - char *versioned_name; -#ifdef ECOFF_DEBUGGING - /* If we are generating ECOFF debugging information, we need some - additional fields for each symbol. */ - struct efdr *ecoff_file; - struct localsym *ecoff_symbol; - valueT ecoff_extern_size; -#endif -}; -#define OBJ_SYMFIELD_TYPE struct elf_obj_sy +/* We need obj-elf for OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined */ +#include "obj-elf.h" #endif |