[PATCH] D152841: Prevent out of range fixup encoding on AArch64

Daniel Hoekwater via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 16:39:56 PDT 2023


dhoekwater added inline comments.


================
Comment at: llvm/test/MC/AArch64/fixup-out-of-range-edge.s:9
+  .word 0
+  .space 1<<20
+  adr x0, adr_lower_range
----------------
efriedma wrote:
> efriedma wrote:
> > MaskRay wrote:
> > > `.space 1<<20` is 1MiB (acceptable, but best not to introduce too many tests like this) and `.space (1<<27)` below needs 128MiB. The large object file makes test slow and won't work on machines with limited disk space. I'd like to hear from other reviewers.
> > I get the concern in general, but I don't think this test actually does anything expensive?  It should error out before the point we actually try to expand ".space" to raw bits.
> Oh, hmm, I guess we don't actually abort emitting the object file even if there's an error.  So that could get a bit expensive.  Only in terms of time, though; it doesn't actually seem to use much memory.  (And disk space is irrelevant if we're outputting to /dev/null.)
Replaced with manual offsets, so we don't need to emit any space at all.


================
Comment at: llvm/test/MC/AArch64/fixup-out-of-range-edge.s:61
+  tbz x0, #1, tbz_lower_range
+
+// CHECK-LABEL: :{{[0-9]+}}:{{[0-9]+}}: error: fixup value out of range
----------------
peter.smith wrote:
> The fixup fixup_aarch64_ldr_pcrel_imm19 is also affected. May be worth a test case for that as well. I think that would look like
> ```
> ldr x0, ldr_low_range 
> ```
Done.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152841



More information about the llvm-commits mailing list