aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2009-05-01 13:50:10 +0000
committerJulian Brown <julian@codesourcery.com>2009-05-01 13:50:10 +0000
commit00adf2d4698cba8b2829652c2bc38c23df3d0ac0 (patch)
tree5ebcec5ac55b8a7191c667f73acd5e83555ed8bf /gas
parent49dff77b6e4a99a16583b1466e260e679661e0de (diff)
downloadgdb-00adf2d4698cba8b2829652c2bc38c23df3d0ac0.zip
gdb-00adf2d4698cba8b2829652c2bc38c23df3d0ac0.tar.gz
gdb-00adf2d4698cba8b2829652c2bc38c23df3d0ac0.tar.bz2
gas/
* config/tc-arm.c (do_t_blx): Always use BFD_RELOC_THUMB_PCREL_BLX. (md_pcrel_from_section): Align address for BLX. (tc_gen_reloc): Change BFD_RELOC_THUMB_PCREL_BLX relocations to BFD_RELOC_THUMB_PCREL_BRANCH23 for EABI v4+.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-arm.c23
2 files changed, 22 insertions, 8 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2591b09..7ac1bf5 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2009-05-01 Julian Brown <julian@codesourcery.com>
+
+ * config/tc-arm.c (do_t_blx): Always use BFD_RELOC_THUMB_PCREL_BLX.
+ (md_pcrel_from_section): Align address for BLX.
+ (tc_gen_reloc): Change BFD_RELOC_THUMB_PCREL_BLX relocations to
+ BFD_RELOC_THUMB_PCREL_BRANCH23 for EABI v4+.
+
2009-04-29 DJ Delorie <dj@redhat.com>
* config/tc-mep.c (md_begin): Check coprocessor type.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 581ffcd..6615aca 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -9002,12 +9002,7 @@ do_t_blx (void)
{
/* No register. This must be BLX(1). */
inst.instruction = 0xf000e800;
-#ifdef OBJ_ELF
- if (EF_ARM_EABI_VERSION (meabi_flags) >= EF_ARM_EABI_VER4)
- inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH23;
- else
-#endif
- inst.reloc.type = BFD_RELOC_THUMB_PCREL_BLX;
+ inst.reloc.type = BFD_RELOC_THUMB_PCREL_BLX;
inst.reloc.pc_rel = 1;
}
}
@@ -18213,9 +18208,13 @@ md_pcrel_from_section (fixS * fixP, segT seg)
case BFD_RELOC_THUMB_PCREL_BRANCH20:
case BFD_RELOC_THUMB_PCREL_BRANCH23:
case BFD_RELOC_THUMB_PCREL_BRANCH25:
- case BFD_RELOC_THUMB_PCREL_BLX:
return base + 4;
+ /* BLX is like branches above, but forces the low two bits of PC to
+ zero. */
+ case BFD_RELOC_THUMB_PCREL_BLX:
+ return (base + 4) & ~3;
+
/* ARM mode branches are offset by +8. However, the Windows CE
loader expects the relocation not to take this into account. */
case BFD_RELOC_ARM_PCREL_BRANCH:
@@ -19737,7 +19736,6 @@ tc_gen_reloc (asection *section, fixS *fixp)
case BFD_RELOC_THUMB_PCREL_BRANCH20:
case BFD_RELOC_THUMB_PCREL_BRANCH23:
case BFD_RELOC_THUMB_PCREL_BRANCH25:
- case BFD_RELOC_THUMB_PCREL_BLX:
case BFD_RELOC_VTABLE_ENTRY:
case BFD_RELOC_VTABLE_INHERIT:
#ifdef TE_PE
@@ -19746,6 +19744,15 @@ tc_gen_reloc (asection *section, fixS *fixp)
code = fixp->fx_r_type;
break;
+ case BFD_RELOC_THUMB_PCREL_BLX:
+#ifdef OBJ_ELF
+ if (EF_ARM_EABI_VERSION (meabi_flags) >= EF_ARM_EABI_VER4)
+ code = BFD_RELOC_THUMB_PCREL_BRANCH23;
+ else
+#endif
+ code = BFD_RELOC_THUMB_PCREL_BLX;
+ break;
+
case BFD_RELOC_ARM_LITERAL:
case BFD_RELOC_ARM_HWLITERAL:
/* If this is called then the a literal has