The Thumb BL and BLX instructions on older Arm Architectures such as v5 and v6 have a constrained encoding that forces the J1 and J2 bits to be equal to 1. Later Architectures relaxed this restriction allowing J1 and J2 to be used to calculate a larger immediate.
This patch adds support for the old encoding when the build attributes for the input objects only contain older architectures. This permits the removal of the warning that LLD always uses the extended branch encoding. I've added --arm-add-build-attributes (generate build attributes from the --triple argument) to the llvm-mc arguments for existing tests that depend on the new encodings.
The J1 and J2 bits are defined in the Arm Architecture Reference Manual: https://developer.arm.com/products/architecture/cpu-architecture/a-profile/docs/ddi0406/latest/arm-architecture-reference-manual-armv7-a-and-armv7-r-edition (search for "BL, BLX (immediate)")
This is patch 1 of 2 to support Arm Architecture v5 and Arm Architecture v6 (as far as a linker is concerned there is no difference between v5 and v6). This will enable LLD to be used to target the first edition of the Raspberry Pi. Patch 2 adds v5/v6 compatible range extension Thunks.