mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-31 06:04:58 +00:00
[MC] Detect out of range jumps further than 2^32 bytes
On AArch64, object files may be greater than 2^32 bytes. If an offset is greater than the max value of a 32-bit unsigned integer, LLVM silently truncates the offset. Instead, make it return an error. Differential Revision: https://reviews.llvm.org/D153494
This commit is contained in:
parent
16e1b8d6c0
commit
d8cef4f8fa
@ -273,7 +273,7 @@ bool MCAssembler::evaluateFixup(const MCAsmLayout &Layout,
|
||||
"FKF_IsAlignedDownTo32Bits is only allowed on PC-relative fixups!");
|
||||
|
||||
if (IsPCRel) {
|
||||
uint32_t Offset = Layout.getFragmentOffset(DF) + Fixup.getOffset();
|
||||
uint64_t Offset = Layout.getFragmentOffset(DF) + Fixup.getOffset();
|
||||
|
||||
// A number of ARM fixups in Thumb mode require that the effective PC
|
||||
// address be determined as the 32-bit aligned version of the actual offset.
|
||||
|
Loading…
x
Reference in New Issue
Block a user