mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
ebd705668f
MachO only has 24-bit addends for most relocations, small enough that it can overflow in semi-reasonable functions and cause insidious bugs if compiled without assertions enabled. Switch it to an actual error instead. The condition isn't quite identical because ld64 treats the addend as a signed number.
15 lines
591 B
ArmAsm
15 lines
591 B
ArmAsm
// RUN: not llvm-mc -triple arm64-apple-ios -filetype=obj -o /dev/null %s 2>&1 | FileCheck %s
|
|
.global _foo
|
|
adrp x0, (_foo + 1)@PAGE
|
|
adrp x0, (_foo - 1)@PAGE
|
|
adrp x0, (_foo + 0x7fffff)@PAGE
|
|
adrp x0, (_foo - 0x800000)@PAGE
|
|
|
|
// CHECK-NOT: error:
|
|
// CHECK: error: addend too big for relocation
|
|
// CHECK: adrp x0, (_foo + 0x800000)@PAGE
|
|
// CHECK: error: addend too big for relocation
|
|
// CHECK: adrp x0, (_foo - 0x800001)@PAGE
|
|
adrp x0, (_foo + 0x800000)@PAGE
|
|
adrp x0, (_foo - 0x800001)@PAGE
|