diff options
Diffstat (limited to 'contrib/binutils/gas/config/obj-coff.h')
-rw-r--r-- | contrib/binutils/gas/config/obj-coff.h | 91 |
1 files changed, 74 insertions, 17 deletions
diff --git a/contrib/binutils/gas/config/obj-coff.h b/contrib/binutils/gas/config/obj-coff.h index f796461..f60ae36 100644 --- a/contrib/binutils/gas/config/obj-coff.h +++ b/contrib/binutils/gas/config/obj-coff.h @@ -1,5 +1,5 @@ /* coff object file format - Copyright (C) 1989, 90, 91, 92, 94, 95, 96, 97, 1998 + Copyright (C) 1989, 90, 91, 92, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS. @@ -110,12 +110,29 @@ #endif #ifdef TC_SH + +#ifdef TE_PE +#define COFF_WITH_PE +#endif + #include "coff/sh.h" + +#ifdef TE_PE +#define TARGET_FORMAT "pe-shl" +#else #define TARGET_FORMAT \ (shl \ ? (sh_small ? "coff-shl-small" : "coff-shl") \ : (sh_small ? "coff-sh-small" : "coff-sh")) #endif +#endif + +#ifdef TC_MIPS +#define COFF_WITH_PE +#include "coff/mipspe.h" +#undef TARGET_FORMAT +#define TARGET_FORMAT "pe-mips" +#endif #ifdef TC_M88K #include "coff/m88k.h" @@ -132,6 +149,18 @@ #define TARGET_FORMAT "coff-tic30" #endif +#ifdef TC_TIC80 +#include "coff/tic80.h" +#define TARGET_FORMAT "coff-tic80" +#define ALIGNMENT_IN_S_FLAGS 1 +#endif + +#ifdef TC_MCORE +#include "coff/mcore.h" +#ifndef TARGET_FORMAT +#define TARGET_FORMAT "pe-mcore" +#endif +#endif /* Targets may also set this. Also, if BFD_ASSEMBLER is defined, this will already have been defined. */ @@ -142,7 +171,7 @@ #define OBJ_COFF_MAX_AUXENTRIES 1 #endif /* OBJ_COFF_MAX_AUXENTRIES */ -extern void coff_obj_symbol_new_hook PARAMS ((struct symbol *)); +extern void coff_obj_symbol_new_hook PARAMS ((symbolS *)); #define obj_symbol_new_hook coff_obj_symbol_new_hook extern void coff_obj_read_begin_hook PARAMS ((void)); @@ -199,31 +228,35 @@ extern void coff_obj_read_begin_hook PARAMS ((void)); /* Alter the field names, for now, until we've fixed up the other references to use the new name. */ #ifdef TC_I960 -#define TC_SYMFIELD_TYPE struct symbol * +#define TC_SYMFIELD_TYPE symbolS * #define sy_tc bal #endif #define OBJ_SYMFIELD_TYPE unsigned long #define sy_obj sy_flags -#define SYM_AUXENT(S) (&coffsymbol ((S)->bsym)->native[1].u.auxent) +#define SYM_AUXENT(S) \ + (&coffsymbol (symbol_get_bfdsym (S))->native[1].u.auxent) +#define SYM_AUXINFO(S) \ + (&coffsymbol (symbol_get_bfdsym (S))->native[1]) #define DO_NOT_STRIP 0 extern void obj_coff_section PARAMS ((int)); /* The number of auxiliary entries */ -#define S_GET_NUMBER_AUXILIARY(s) (coffsymbol((s)->bsym)->native->u.syment.n_numaux) +#define S_GET_NUMBER_AUXILIARY(s) \ + (coffsymbol (symbol_get_bfdsym (s))->native->u.syment.n_numaux) /* The number of auxiliary entries */ #define S_SET_NUMBER_AUXILIARY(s,v) (S_GET_NUMBER_AUXILIARY (s) = (v)) /* True if a symbol name is in the string table, i.e. its length is > 8. */ #define S_IS_STRING(s) (strlen(S_GET_NAME(s)) > 8 ? 1 : 0) -extern int S_SET_DATA_TYPE PARAMS ((struct symbol *, int)); -extern int S_SET_STORAGE_CLASS PARAMS ((struct symbol *, int)); -extern int S_GET_STORAGE_CLASS PARAMS ((struct symbol *)); -extern void SA_SET_SYM_ENDNDX PARAMS ((struct symbol *, struct symbol *)); +extern int S_SET_DATA_TYPE PARAMS ((symbolS *, int)); +extern int S_SET_STORAGE_CLASS PARAMS ((symbolS *, int)); +extern int S_GET_STORAGE_CLASS PARAMS ((symbolS *)); +extern void SA_SET_SYM_ENDNDX PARAMS ((symbolS *, symbolS *)); /* Auxiliary entry macros. SA_ stands for symbol auxiliary */ /* Omit the tv related fields */ @@ -285,9 +318,9 @@ extern void SA_SET_SYM_ENDNDX PARAMS ((struct symbol *, struct symbol *)); /* All other bits are unused. */ /* Accessors */ -#define SF_GET(s) ((s)->sy_flags) -#define SF_GET_DEBUG(s) ((s)->bsym->flags & BSF_DEBUGGING) -#define SF_SET_DEBUG(s) ((s)->bsym->flags |= BSF_DEBUGGING) +#define SF_GET(s) (*symbol_get_obj (s)) +#define SF_GET_DEBUG(s) (symbol_get_bfdsym (s)->flags & BSF_DEBUGGING) +#define SF_SET_DEBUG(s) (symbol_get_bfdsym (s)->flags |= BSF_DEBUGGING) #define SF_GET_NORMAL_FIELD(s) (SF_GET (s) & SF_NORMAL_MASK) #define SF_GET_DEBUG_FIELD(s) (SF_GET (s) & SF_DEBUG_MASK) #define SF_GET_FILE(s) (SF_GET (s) & SF_FILE) @@ -333,26 +366,29 @@ extern int coff_line_base; extern int coff_n_line_nos; #define obj_emit_lineno(WHERE,LINE,FILE_START) abort () -extern void coff_add_linesym PARAMS ((struct symbol *)); +extern void coff_add_linesym PARAMS ((symbolS *)); void c_dot_file_symbol PARAMS ((char *filename)); #define obj_app_file c_dot_file_symbol -extern void coff_frob_symbol PARAMS ((struct symbol *, int *)); +extern void coff_frob_symbol PARAMS ((symbolS *, int *)); extern void coff_adjust_symtab PARAMS ((void)); extern void coff_frob_section PARAMS ((segT)); extern void coff_adjust_section_syms PARAMS ((bfd *, asection *, PTR)); extern void coff_frob_file_after_relocs PARAMS ((void)); #define obj_frob_symbol(S,P) coff_frob_symbol(S,&P) +#ifndef obj_adjust_symtab #define obj_adjust_symtab() coff_adjust_symtab() +#endif #define obj_frob_section(S) coff_frob_section (S) #define obj_frob_file_after_relocs() coff_frob_file_after_relocs () -extern struct symbol *coff_last_function; +extern symbolS *coff_last_function; /* Forward the segment of a forwarded symbol, handle assignments that just copy symbol values, etc. */ +#ifndef OBJ_COPY_SYMBOL_ATTRIBUTES #ifndef TE_I386AIX #define OBJ_COPY_SYMBOL_ATTRIBUTES(dest,src) \ (SF_GET_GET_SEGMENT (dest) \ @@ -364,6 +400,7 @@ extern struct symbol *coff_last_function; ? (S_SET_SEGMENT (dest, S_GET_SEGMENT (src)), 0) \ : 0) #endif +#endif /* sanity check */ @@ -468,6 +505,16 @@ typedef struct /* True if a symbol name is in the string table, i.e. its length is > 8. */ #define S_IS_STRING(s) (strlen(S_GET_NAME(s)) > 8 ? 1 : 0) +/* True if a symbol is defined as weak. */ +#ifdef TE_PE +#define S_IS_WEAK(s) \ + ((s)->sy_symbol.ost_entry.n_sclass == C_NT_WEAK \ + || (s)->sy_symbol.ost_entry.n_sclass == C_WEAKEXT) +#else +#define S_IS_WEAK(s) \ + ((s)->sy_symbol.ost_entry.n_sclass == C_WEAKEXT) +#endif + /* Accessors */ /* The name of the symbol */ #define S_GET_NAME(s) ((char*)(s)->sy_symbol.ost_entry.n_offset) @@ -753,7 +800,7 @@ extern void c_dot_file_symbol PARAMS ((char *filename)); #define obj_app_file c_dot_file_symbol extern void obj_extra_stuff PARAMS ((object_headers * headers)); -extern segT s_get_segment PARAMS ((struct symbol * ptr)); +extern segT s_get_segment PARAMS ((symbolS *ptr)); extern void c_section_header PARAMS ((struct internal_scnhdr * header, char *name, @@ -767,7 +814,7 @@ extern void c_section_header PARAMS ((struct internal_scnhdr * header, long alignment)); #ifndef tc_coff_symbol_emit_hook -void tc_coff_symbol_emit_hook PARAMS ((struct symbol *)); +void tc_coff_symbol_emit_hook PARAMS ((symbolS *)); #endif /* sanity check */ @@ -793,6 +840,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, @@ -813,4 +866,8 @@ extern void obj_coff_pe_handle_link_once (); extern void obj_coff_init_stab_section PARAMS ((segT)); #define INIT_STAB_SECTION(seg) obj_coff_init_stab_section (seg) +/* Store the number of relocations in the section aux entry. */ +#define SET_SECTION_RELOCS(sec, relocs, n) \ + SA_SET_SCN_NRELOC (section_symbol (sec), n) + #endif /* OBJ_FORMAT_H */ |