aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-12-05 11:46:50 +0000
committerAlan Modra <amodra@gmail.com>2002-12-05 11:46:50 +0000
commit114424c6b3c664cb3a79d26883771c429633ffd1 (patch)
treede133fd30d8e1756fcb0f4ecdf3a1e2954fff961
parentd1973055b8847315e5783ae04ab701b632fd3a8b (diff)
downloadgdb-114424c6b3c664cb3a79d26883771c429633ffd1.zip
gdb-114424c6b3c664cb3a79d26883771c429633ffd1.tar.gz
gdb-114424c6b3c664cb3a79d26883771c429633ffd1.tar.bz2
* config/tc-arm.c (arm_force_relocation): Move out of #if OBJ_ELF.
Move OBJ_COFF TC_FORCE_RELOCATION code here so that COFF handles ARM_IMMEDIATE and ARM_ADRL_IMMEDIATE relocs as for ELF. * config/tc-arm.h (TC_FORCE_RELOCATION): Define for both ELF and COFF to call arm_force_relocation.
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/config/tc-arm.c47
-rw-r--r--gas/config/tc-arm.h8
3 files changed, 38 insertions, 25 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index abf40ea..4283fea 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,11 @@
+2002-12-05 Alan Modra <amodra@bigpond.net.au>
+
+ * config/tc-arm.c (arm_force_relocation): Move out of #if OBJ_ELF.
+ Move OBJ_COFF TC_FORCE_RELOCATION code here so that COFF handles
+ ARM_IMMEDIATE and ARM_ADRL_IMMEDIATE relocs as for ELF.
+ * config/tc-arm.h (TC_FORCE_RELOCATION): Define for both ELF and
+ COFF to call arm_force_relocation.
+
2002-12-04 David Mosberger <davidm@hpl.hp.com>
* config/tc-ia64.c (pseudo_func): Add "@pause" constant for "hint"
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index f78f100..9682141 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -11432,6 +11432,32 @@ arm_validate_fix (fixP)
}
}
+int
+arm_force_relocation (fixp)
+ struct fix * fixp;
+{
+#if defined (OBJ_COFF) && defined (TE_PE)
+ if (fixp->fx_r_type == BFD_RELOC_RVA)
+ return 1;
+#endif
+#ifdef OBJ_ELF
+ if ( fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
+ || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY
+ || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH
+ || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BLX
+ || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX
+ || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BRANCH23)
+ return 1;
+#endif
+
+ /* Resolve these relocations even if the symbol is extern or weak. */
+ if (fixp->fx_r_type == BFD_RELOC_ARM_IMMEDIATE
+ || fixp->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE)
+ return 0;
+
+ return S_FORCE_RELOC (fixp->fx_addsy);
+}
+
#ifdef OBJ_COFF
/* This is a little hack to help the gas/arm/adrl.s test. It prevents
local labels from being added to the output symbol table when they
@@ -11448,6 +11474,7 @@ arm_fix_adjustable (fixP)
return 0;
}
#endif
+
#ifdef OBJ_ELF
/* Relocations against Thumb function names must be left unadjusted,
so that the linker can use this information to correctly set the
@@ -11514,26 +11541,6 @@ armelf_frob_symbol (symp, puntp)
elf_frob_symbol (symp, puntp);
}
-int
-arm_force_relocation (fixp)
- struct fix * fixp;
-{
- if ( fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
- || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY
- || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH
- || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BLX
- || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX
- || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BRANCH23)
- return 1;
-
- /* Resolve these relocations even if the symbol is extern or weak. */
- if (fixp->fx_r_type == BFD_RELOC_ARM_IMMEDIATE
- || fixp->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE)
- return 0;
-
- return S_FORCE_RELOC (fixp->fx_addsy);
-}
-
static bfd_reloc_code_real_type
arm_parse_reloc ()
{
diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h
index 441c16f..3b98b33 100644
--- a/gas/config/tc-arm.h
+++ b/gas/config/tc-arm.h
@@ -77,8 +77,6 @@ struct fix;
#ifdef OBJ_COFF
# if defined TE_PE
-# define TC_FORCE_RELOCATION(x) \
- ((x)->fx_r_type == BFD_RELOC_RVA || S_FORCE_RELOC ((x)->fx_addsy))
# ifdef TE_EPOC
# define TARGET_FORMAT (target_big_endian ? "epoc-pe-arm-big" : "epoc-pe-arm-little")
# else
@@ -92,11 +90,11 @@ struct fix;
#ifdef OBJ_ELF
# define TARGET_FORMAT elf32_arm_target_format()
extern const char * elf32_arm_target_format PARAMS ((void));
-
-# define TC_FORCE_RELOCATION(FIX) arm_force_relocation (FIX)
- extern int arm_force_relocation PARAMS ((struct fix *));
#endif
+#define TC_FORCE_RELOCATION(FIX) arm_force_relocation (FIX)
+extern int arm_force_relocation PARAMS ((struct fix *));
+
#define md_convert_frag(b, s, f) {as_fatal (_("arm convert_frag\n"));}
#define md_cleanup() arm_cleanup ()