[PATCH] D46305: [MC][ARM] Correct Thumb BL instruction range

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 2 04:02:55 PDT 2018


peter.smith updated this revision to Diff 144846.
peter.smith added a comment.

Thanks for the comments. I've rebased on top of https://reviews.llvm.org/D44928, only change to the source is STI. goes to STI->. I've added .arch directives to the test to check that we can switch and keep the correct check. By the way I'd be really grateful if you could accept https://reviews.llvm.org/D44928, I've been threatening to commit it unless there are any objections, but I'd feel better if the review was accepted.

On the linker side. From the BuildAttributes, specifically Tag_CPU_arch, a static linker can work out at the object level what a file was compiled for. In general linkers follow the combination rules in the ABI so that if at least one object contains Tag_CPU_arch with an architecture that supports the longer branch range, then the linker will use the longer branch range. This model doesn't work so well when there are different attributes in different functions or sections, finer grained attributes are defined in the ABI but are deprecated/optional as most linkers don't support them. However, in the most common case, where the object architecture is lower than any local change to a higher architecture for runtime selection, the linker should use the shorter range for any relocation which is at least safe.


https://reviews.llvm.org/D46305

Files:
  lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
  test/MC/ARM/thumb-branches.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46305.144846.patch
Type: text/x-patch
Size: 3945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180502/11959ddc/attachment.bin>


More information about the llvm-commits mailing list