[PATCH] D146618: [ExecutionEngine] Fix R_AARCH64_ABS{16, 32} assertion
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 5 06:56:03 PDT 2023
MaskRay added inline comments.
================
Comment at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:429
uint64_t Result = Value + Addend;
- assert(static_cast<int64_t>(Result) >= INT16_MIN && Result < UINT16_MAX);
+ assert(static_cast<int64_t>(Result) >= INT16_MIN &&
+ static_cast<int64_t>(Result) < UINT16_MAX);
----------------
MaskRay wrote:
> The change is incorrect.
>
> `R_AARCH64_ABS16` permits either signed or unsigned narrow values. See https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst
>
> The original assert conditions had off-by-1 issues, which I just fixed in 7b58259481417bb22d144a9c12ee8f4fb0a046e0.
Sorry, I'll fix my conditions according to lld/ELF/Target.h in a few hours...
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146618/new/
https://reviews.llvm.org/D146618
More information about the llvm-commits
mailing list