#define TARGET_FORMAT "coff-tic30"
#endif
+#ifdef TC_TIC4X
+#include "coff/tic4x.h"
+#define TARGET_FORMAT "coff2-c4x"
+#endif
+
#ifdef TC_TIC54X
#include "coff/tic54x.h"
#define TARGET_FORMAT "coff1-c54x"
#define OBJ_SYMFIELD_TYPE unsigned long
#define sy_obj sy_flags
+/* We can't use the predefined section symbols in bfd/section.c, as
+ COFF symbols have extra fields. See bfd/libcoff.h:coff_symbol_type. */
+#ifndef obj_sec_sym_ok_for_reloc
+#define obj_sec_sym_ok_for_reloc(SEC) ((SEC)->owner != 0)
+#endif
+
#define SYM_AUXENT(S) \
(&coffsymbol (symbol_get_bfdsym (S))->native[1].u.auxent)
#define SYM_AUXINFO(S) \
#define SA_SET_SCN_NLINNO(s,v) (SYM_AUXENT (s)->x_scn.x_nlinno=(v))
/* Internal use only definitions. SF_ stands for symbol flags.
-
+
These values can be assigned to sy_symbol.ost_flags field of a symbolS.
-
+
You'll break i960 if you shift the SYSPROC bits anywhere else. for
more on the balname/callname hack, see tc-i960.h. b.out is done
differently. */
/* Predicates. */
/* True if the symbol is external. */
-#define S_IS_EXTERNAL(s) ((s)->sy_symbol.ost_entry.n_scnum == C_UNDEF_SECTION)
+#define S_IS_EXTERNAL(s) \
+ ((s)->sy_symbol.ost_entry.n_scnum == C_UNDEF_SECTION)
+
/* True if symbol has been defined, ie :
section > 0 (DATA, TEXT or BSS)
section == 0 and value > 0 (external bss symbol). */
|| ((s)->sy_symbol.ost_entry.n_scnum == C_UNDEF_SECTION \
&& S_GET_VALUE (s) > 0) \
|| ((s)->sy_symbol.ost_entry.n_scnum == C_ABS_SECTION))
+
+/* Return true for symbols that should not be reduced to section
+ symbols or eliminated from expressions, because they may be
+ overridden by the linker. */
+#define S_FORCE_RELOC(s) \
+ (!SEG_NORMAL (S_GET_SEGMENT (s)) || S_IS_WEAK (s))
+
/* True if a debug special symbol entry. */
-#define S_IS_DEBUG(s) ((s)->sy_symbol.ost_entry.n_scnum == C_DEBUG_SECTION)
+#define S_IS_DEBUG(s) \
+ ((s)->sy_symbol.ost_entry.n_scnum == C_DEBUG_SECTION)
+
/* True if a symbol is local symbol name. */
/* A symbol name whose name includes ^A is a gas internal pseudo symbol. */
#define S_IS_LOCAL(s) \
|| (flag_strip_local_absolute \
&& !S_IS_EXTERNAL(s) \
&& (s)->sy_symbol.ost_entry.n_scnum == C_ABS_SECTION))
+
/* True if a symbol is not defined in this file. */
#define S_IS_EXTERN(s) ((s)->sy_symbol.ost_entry.n_scnum == 0 \
&& S_GET_VALUE (s) == 0)
+
/* True if a symbol can be multiply defined (bss symbols have this def
though it is bad practice). */
#define S_IS_COMMON(s) ((s)->sy_symbol.ost_entry.n_scnum == 0 \
&& S_GET_VALUE (s) != 0)
+
/* 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)
/* Accessors. */
/* The name of the symbol. */
#define S_GET_NAME(s) ((char*) (s)->sy_symbol.ost_entry.n_offset)
+
/* The pointer to the string table. */
#define S_GET_OFFSET(s) ((s)->sy_symbol.ost_entry.n_offset)
+
/* The numeric value of the segment. */
#define S_GET_SEGMENT(s) s_get_segment(s)
+
/* The data type. */
#define S_GET_DATA_TYPE(s) ((s)->sy_symbol.ost_entry.n_type)
+
/* The storage class. */
#define S_GET_STORAGE_CLASS(s) ((s)->sy_symbol.ost_entry.n_sclass)
+
/* The number of auxiliary entries. */
#define S_GET_NUMBER_AUXILIARY(s) ((s)->sy_symbol.ost_entry.n_numaux)
/* Modifiers. */
/* Set the name of the symbol. */
-#define S_SET_NAME(s,v) ((s)->sy_symbol.ost_entry.n_offset = (unsigned long) (v))
+#define S_SET_NAME(s,v) \
+ ((s)->sy_symbol.ost_entry.n_offset = (unsigned long) (v))
+
/* Set the offset of the symbol. */
-#define S_SET_OFFSET(s,v) ((s)->sy_symbol.ost_entry.n_offset = (v))
+#define S_SET_OFFSET(s,v) \
+ ((s)->sy_symbol.ost_entry.n_offset = (v))
+
/* The numeric value of the segment. */
-#define S_SET_SEGMENT(s,v) ((s)->sy_symbol.ost_entry.n_scnum = SEGMENT_TO_SYMBOL_TYPE(v))
+#define S_SET_SEGMENT(s,v) \
+ ((s)->sy_symbol.ost_entry.n_scnum = SEGMENT_TO_SYMBOL_TYPE(v))
+
/* The data type. */
-#define S_SET_DATA_TYPE(s,v) ((s)->sy_symbol.ost_entry.n_type = (v))
+#define S_SET_DATA_TYPE(s,v) \
+ ((s)->sy_symbol.ost_entry.n_type = (v))
+
/* The storage class. */
-#define S_SET_STORAGE_CLASS(s,v) ((s)->sy_symbol.ost_entry.n_sclass = (v))
+#define S_SET_STORAGE_CLASS(s,v) \
+ ((s)->sy_symbol.ost_entry.n_sclass = (v))
+
/* The number of auxiliary entries. */
-#define S_SET_NUMBER_AUXILIARY(s,v) ((s)->sy_symbol.ost_entry.n_numaux = (v))
+#define S_SET_NUMBER_AUXILIARY(s,v) \
+ ((s)->sy_symbol.ost_entry.n_numaux = (v))
/* Additional modifiers. */
/* The symbol is external (does not mean undefined). */
-#define S_SET_EXTERNAL(s) { S_SET_STORAGE_CLASS(s, C_EXT) ; SF_CLEAR_LOCAL(s); }
+#define S_SET_EXTERNAL(s) \
+ { S_SET_STORAGE_CLASS(s, C_EXT) ; SF_CLEAR_LOCAL(s); }
/* Auxiliary entry macros. SA_ stands for symbol auxiliary. */
/* Omit the tv related fields. */
#define SA_SET_SCN_NLINNO(s,v) (SYM_AUXENT (s)->x_scn.x_nlinno=(v))
/* Internal use only definitions. SF_ stands for symbol flags.
-
+
These values can be assigned to sy_symbol.ost_flags field of a symbolS.
-
+
You'll break i960 if you shift the SYSPROC bits anywhere else. for
more on the balname/callname hack, see tc-i960.h. b.out is done
differently. */