* as.c (debug_type): Init to DEBUG_UNSPECIFIED.
[deliverable/binutils-gdb.git] / gas / config / tc-sh.h
index 099e91539198a01afcfa0ed9151cd5e3977c6988..ed17a47ff83c89f26c90b423251c444375e23f18 100644 (file)
@@ -41,6 +41,9 @@ extern int sh_small;
 /* Don't try to break words.  */
 #define WORKING_DOT_WORD
 
+/* All SH instructions are multiples of 16 bits.  */
+#define DWARF2_LINE_MIN_INSN_LENGTH 2
+
 /* We require .long, et. al., to be aligned correctly.  */
 #define md_cons_align(nbytes) sh_cons_align (nbytes)
 extern void sh_cons_align PARAMS ((int));
@@ -58,6 +61,10 @@ extern int sh_force_relocation ();
 #define obj_fix_adjustable(fixP) sh_fix_adjustable(fixP)
 struct fix;
 extern boolean sh_fix_adjustable PARAMS ((struct fix *));
+
+/* This arranges for gas/write.c to not apply a relocation if
+   obj_fix_adjustable() says it is not adjustable.  */
+#define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP)
 #endif
 
 #define IGNORE_NONSTANDARD_ESCAPES
@@ -130,18 +137,20 @@ extern void sh_coff_reloc_mangle
 extern int tc_coff_sizemachdep PARAMS ((fragS *));
 
 #ifdef BFD_ASSEMBLER
-#define SUB_SEGMENT_ALIGN(SEG) 4
+#define SEG_NAME(SEG) segment_name (SEG)
 #else
+#define SEG_NAME(SEG) obj_segment_name (SEG)
+#endif
+
 /* We align most sections to a 16 byte boundary.  */
-#define SUB_SEGMENT_ALIGN(SEG)                                 \
-  (strncmp (obj_segment_name (SEG), ".stabstr", 8) == 0                \
-   ? 0                                                         \
-   : ((strncmp (obj_segment_name (SEG), ".stab", 5) == 0       \
-       || strcmp (obj_segment_name (SEG), ".ctors") == 0       \
-       || strcmp (obj_segment_name (SEG), ".dtors") == 0)      \
-      ? 2                                                      \
+#define SUB_SEGMENT_ALIGN(SEG)                         \
+  (strncmp (SEG_NAME (SEG), ".stabstr", 8) == 0                \
+   ? 0                                                 \
+   : ((strncmp (SEG_NAME (SEG), ".stab", 5) == 0       \
+       || strcmp (SEG_NAME (SEG), ".ctors") == 0       \
+       || strcmp (SEG_NAME (SEG), ".dtors") == 0)      \
+      ? 2                                              \
       : (sh_small ? 2 : 4)))
-#endif
 
 #endif /* OBJ_COFF */
 
@@ -151,11 +160,49 @@ extern int tc_coff_sizemachdep PARAMS ((fragS *));
 /* Whether or not the target is big endian */
 extern int target_big_endian;
 
+#ifdef TE_LINUX
+#define TARGET_FORMAT (shl ? "elf32-sh-linux" : "elf32-shbig-linux")
+#else
 #define TARGET_FORMAT (shl ? "elf32-shl" : "elf32-sh")
+#endif
 
 #define elf_tc_final_processing sh_elf_final_processing
 extern void sh_elf_final_processing PARAMS ((void));
 
-#endif /* OBJ_ELF */
+#define DIFF_EXPR_OK           /* foo-. gets turned into PC relative relocs */
+
+#define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_"
+
+/* This is the relocation type for direct references to
+   GLOBAL_OFFSET_TABLE.  It comes up in complicated expressions such
+   as _GLOBAL_OFFSET_TABLE_+[.-.L284], which cannot be expressed
+   normally with the regular expressions.  The fixup specified here
+   when used at runtime implies that we should add the address of the
+   GOT to the specified location, and as a result we have simplified
+   the expression into something we can use.  */
+#define TC_RELOC_GLOBAL_OFFSET_TABLE BFD_RELOC_SH_GOTPC
+
+/* This expression evaluates to false if the relocation is for a local object
+   for which we still want to do the relocation at runtime.  True if we
+   are willing to perform this relocation while building the .o file.
+   This is only used for pcrel relocations, so GOTOFF does not need to be
+   checked here.  I am not sure if some of the others are ever used with
+   pcrel, but it is easier to be safe than sorry.
+
+   We can't resolve references to the GOT or the PLT when creating the
+   object file, since these tables are only created by the linker.
+   Also, if the symbol is global, weak, common or not defined, the
+   assembler can't compute the appropriate reloc, since its location
+   can only be determined at link time.  */
+
+#define TC_RELOC_RTSYM_LOC_FIXUP(FIX)                          \
+  ((FIX)->fx_r_type != BFD_RELOC_32_PLT_PCREL                  \
+   && (FIX)->fx_r_type != BFD_RELOC_32_GOT_PCREL               \
+   && (FIX)->fx_r_type != BFD_RELOC_SH_GOTPC                   \
+   && ((FIX)->fx_addsy == NULL                                 \
+       || (! S_IS_EXTERNAL ((FIX)->fx_addsy)                   \
+          && ! S_IS_WEAK ((FIX)->fx_addsy)                     \
+          && S_IS_DEFINED ((FIX)->fx_addsy)                    \
+          && ! S_IS_COMMON ((FIX)->fx_addsy))))
 
-/* end of tc-sh.h */
+#endif /* OBJ_ELF */
This page took 0.025641 seconds and 4 git commands to generate.