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

Daniel Hoekwater via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 14:33:27 PDT 2023


dhoekwater added a comment.

In D152841#4426615 <https://reviews.llvm.org/D152841#4426615>, @efriedma wrote:

> printf ".Lfoo:\n.space (1<<32)\ntbz x0, #1, .Lfoo\n" | llvm-mc -triple=aarch64 -filetype=obj -o  /dev/null

This looks like it's caused by `// uint32_t Offset = Layout.getFragmentOffset(DF) + Fixup.getOffset();` in `MCAssembler.cpp:276`, which should be replaced with a `uint64_t`. I can't find a good way to test it without writing `.space 1 << 32`, which isn't preferable for the reasons listed above. I'm actually not sure where it should be fixed/tested, as it's not AArch64-specific.


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