diff options
author | Julian Brown <julian@codesourcery.com> | 2012-11-28 16:53:01 +0000 |
---|---|---|
committer | Julian Brown <julian@codesourcery.com> | 2012-11-28 16:53:01 +0000 |
commit | d406f3e430b5a156b943895791f2d081e78c8194 (patch) | |
tree | edf2785b15c2370ff2b1d168e0cde28e2bbe6b73 /gas/config | |
parent | 945bf7131824a5af68e72be4f29b04d20010b83b (diff) | |
download | gdb-d406f3e430b5a156b943895791f2d081e78c8194.zip gdb-d406f3e430b5a156b943895791f2d081e78c8194.tar.gz gdb-d406f3e430b5a156b943895791f2d081e78c8194.tar.bz2 |
gas/
* config/tc-arm.c (md_apply_fix): Fix conversion of BL to BLX for
local targets in Thumb mode.
gas/testsuite/
* gas/arm/bl-local-2.s: New test.
* gas/arm/bl-local-2.d: New.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-arm.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 4cd2745..2841abb 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -22040,18 +22040,18 @@ md_apply_fix (fixS * fixP, thumb_bl_common: -#ifdef OBJ_ELF - if (EF_ARM_EABI_VERSION (meabi_flags) >= EF_ARM_EABI_VER4 - && fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX) - fixP->fx_r_type = BFD_RELOC_THUMB_PCREL_BRANCH23; -#endif - if (fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX) /* For a BLX instruction, make sure that the relocation is rounded up to a word boundary. This follows the semantics of the instruction which specifies that bit 1 of the target address will come from bit 1 of the base address. */ - value = (value + 1) & ~ 1; + value = (value + 3) & ~ 3; + +#ifdef OBJ_ELF + if (EF_ARM_EABI_VERSION (meabi_flags) >= EF_ARM_EABI_VER4 + && fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX) + fixP->fx_r_type = BFD_RELOC_THUMB_PCREL_BRANCH23; +#endif if ((value & ~0x3fffff) && ((value & ~0x3fffff) != ~0x3fffff)) { |