aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-sh.h
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2000-09-02 02:36:27 +0000
committerAlexandre Oliva <aoliva@redhat.com>2000-09-02 02:36:27 +0000
commita1cc9221e2f5771188b5832633eb73ee2bbbb4c5 (patch)
tree7abae9229c83c3e90771b75ffeeff560c667c8c8 /gas/config/tc-sh.h
parent37c644f2f5e7b4dce05757b8cd5822f971f6d5d8 (diff)
downloadgdb-a1cc9221e2f5771188b5832633eb73ee2bbbb4c5.zip
gdb-a1cc9221e2f5771188b5832633eb73ee2bbbb4c5.tar.gz
gdb-a1cc9221e2f5771188b5832633eb73ee2bbbb4c5.tar.bz2
* config/tc-sh.h [OBJ_ELF] (TC_FIX_ADJUSTABLE): Define.
* config/tc-sh.c (md_apply_fix): Map 32-bit relocations that become PC-relative to BFD_RELOC_32_PCREL. Reject 16- or 8-bit similar relocs. (sh_obj_adjustable): Return 1 for PC-relative offsets used in branches. * config/tc-sh.h (DIFF_EXPR_OK, GLOBAL_OFFSET_TABLE_NAME, TC_RELOC_GLOBAL_OFFSET_TABLE, TC_RELOC_RTSYM_LOC_FIXUP): Define. * config/tc-sh.c (sh_elf_cons, sh_elf_suffix): New functions. [OBJ_ELF] (md_pseudo_table) <long, int, word, short>: Use them. (GOT_symbol): New variable. (md_undefined_symbol): Set it.
Diffstat (limited to 'gas/config/tc-sh.h')
-rw-r--r--gas/config/tc-sh.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/gas/config/tc-sh.h b/gas/config/tc-sh.h
index 4e73b8b..54ba1b9 100644
--- a/gas/config/tc-sh.h
+++ b/gas/config/tc-sh.h
@@ -61,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
@@ -161,6 +165,42 @@ extern int target_big_endian;
#define elf_tc_final_processing sh_elf_final_processing
extern void sh_elf_final_processing PARAMS ((void));
+#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))))
+
#endif /* OBJ_ELF */
#define md_end() sh_finalize ()