The Thumb BL range is +- either 16 Megabytes or 4 Megabytes depending on whether the CPU supports Thumb2 or the v8-m baseline ops. The existing check for BL range is incorrectly set at +- 32 Megabytes. This change corrects the higher range and uses the lower range if the featurebits don't have the necessary support for it.
The ranges for the branch instructions can be found in https://developer.arm.com/docs/ddi0406/c/arm-architecture-reference-manual-armv7-a-and-armv7-r-edition
For version C (latest) the higher range can be found in A4.3 Branch instructions
For the shorter range search for "BL and BLX (immediate) instructions, before ARMv6T2", this also applies to ARMv6M.
I note that there isn't a range check for BLX, but as far as I can tell, the shouldForceRelocation() always generates an external relocation for this case.
There are also no range checks for B.W and Bcc.W, I have a follow up patch that adds checks for these that I'll post shortly.
I think we also need to check for HasV6MOps here.