To support errata patching on AArch64 we need to be able to overwrite an arbitrary instruction with a branch. For AArch64 it is sufficient to always write all the bits of the branch instruction and not just the immediate field. This is safe as the non-immediate bits of the branch instruction are always the same.
This is patch 2 of 3 to fix pr33463 https://bugs.llvm.org/show_bug.cgi?id=33463 although it can stand independently. The general idea for the fix will be to change an instruction in the section to be patched by adding a branch relocation (or modifying an existing relocation) at the same offset as the instruction.
Can you mention that this is for --fix-cortex-a53-843419, as what this code does is unusual and doesn't make much sense unless the reader understand this is for a CPU bug.