[PATCH] D153494: Detect out of range jumps further than 2^32 bytes

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 01:22:31 PDT 2023


peter.smith added a comment.

Although not specifically part of this patch, for branch relocations, exposing these to the linker like we do in AArch32 would permit branches that can reach outside the section to be range-extended by thunks. For example in the test case above distant could be fixed up at link time.

Another not specifically part of this patch, is that for AArch64 we should probably give an error message when the section size gets bigger than 4 GiB as if we are resolving branches internally and not passing them on to the linker, that is the largest we can support without giving an obtuse error message. We have seen this cause trouble with GCC with an internal code-generator that generated a single gigantic .C file, without -ffunction-sections it produced a giant 4 GiB section.

I'm inclined to agree with MaskRay about not requiring a test. We do have some 32-bit systems such as Arm AArch32 that have a build bot, I'm not sure whether they would be able to cope with this test case and I'm not sure we can turn off tests on a host rather than target basis.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153494/new/

https://reviews.llvm.org/D153494



More information about the llvm-commits mailing list