Apply Nick Clifton's suggestion.
[deliverable/binutils-gdb.git] / gas / config / obj-coff.h
index 351fdb46824834e4ebcb3b7f0678c94a39e55f63..a23eeacb2edf48cbcfcaf374c665dfc5a33f2882 100644 (file)
@@ -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.
 #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"
 #define TARGET_FORMAT "coff-tic30"
 #endif
 
-/* start-sanitize-tic80 */
+#ifdef TC_TIC54X
+#include "coff/tic54x.h"
+#define TARGET_FORMAT "coff1-c54x"
+#endif
+
 #ifdef TC_TIC80
 #include "coff/tic80.h"
 #define TARGET_FORMAT "coff-tic80"
 #define ALIGNMENT_IN_S_FLAGS 1
 #endif
-/* end-sanitize-tic80 */
+
+#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.  */
 #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));
@@ -206,32 +233,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_AUXINFO(S) (&coffsymbol ((S)->bsym)->native[1])
+#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 */
@@ -293,9 +323,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)
@@ -341,26 +371,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));
+void c_dot_file_symbol PARAMS ((const 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) \
@@ -372,6 +405,7 @@ extern struct symbol *coff_last_function;
    ? (S_SET_SEGMENT (dest, S_GET_SEGMENT (src)), 0) \
    : 0)
 #endif
+#endif
 
 /* sanity check */
 
@@ -476,6 +510,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)
@@ -761,7 +805,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,
@@ -775,7 +819,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 */
@@ -801,6 +845,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,
@@ -821,4 +871,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 */
This page took 0.026174 seconds and 4 git commands to generate.