https://sourceware.org/bugzilla/show_bug.cgi?id=24991
--- Comment #9 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> --- The binutils-2_33-branch branch has been updated by Tamar Christina <tnfch...@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2948a47219b2000e389faaa3df6fa5eaf330b7ff commit 2948a47219b2000e389faaa3df6fa5eaf330b7ff Author: Tamar Christina <tamar.christ...@arm.com> Date: Tue Sep 24 14:46:17 2019 +0100 Arm: Fix out of range conditional branch (PR/24991) The fix for PR12848 introduced an off by one error in the mask, this corrected the negative overflows but not the positive overflows. As a result the conditional branch instructions accepted a too wide positive immediate which resulted in it corrupting the instruction during encoding. The relocation I believe has been incorrectly named, to be consistent with the other relocations it should have been named BRANCH21 which is why the masks for it are confusing. I've replaced the masks with a function out_of_range_p which should make it harder to make such mistakes. The mask for BL/BLX on Armv6t+ is also wrong, the extended range is 25-bits and so the mask should be checking for 24-bits for positive overflow. gas/ChangeLog: PR gas/24991 * config/tc-arm.c (out_of_range_p): New. (md_apply_fix): Use it in BFD_RELOC_THUMB_PCREL_BRANCH9, BFD_RELOC_THUMB_PCREL_BRANCH12, BFD_RELOC_THUMB_PCREL_BRANCH20, BFD_RELOC_THUMB_PCREL_BRANCH23, BFD_RELOC_THUMB_PCREL_BRANCH25 * testsuite/gas/arm/pr24991.d: New test. * testsuite/gas/arm/pr24991.l: New test. * testsuite/gas/arm/pr24991.s: New test. (cherry picked from commit e8f8842d90abe5eafa8c32f08fbc3a747a45747c) -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils