[PATCH] Fix Thumb-2 BLX misassembly

Julian Brown julian@codesourcery.com
Fri May 1 10:39:00 GMT 2009


Hi,

This patch fixes disassembly of Thumb-2 BLX instructions (to ARM-mode
code). At present, the low bit is sometimes erroneously set (depending
on the offsets involved), which creates an undefined instruction.

Tested with cross to arm-linux-gnueabi, with a new test case.

OK to apply?

Thanks,

Julian

ChangeLog

    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+.

    ld/testsuite/
    * ld-arm/arm-elf.exp (armeabitests): Add thumb2-bl-blx-interwork
    test.
    * ld-arm/thumb2-bl-blx-interwork.s: New.
    * ld-arm/thumb2-bl-blx-interwork.d: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: blx-fix-1.diff
Type: text/x-patch
Size: 5750 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20090501/da94a802/attachment.bin>


More information about the Binutils mailing list