A 64-bit relocation does not exist in 32-bit ARMELF. Report an error
instead of crashing.
PR23870
Patch by Sanne Wouda (sanwou01).
Differential Revision: https://reviews.llvm.org/D28851
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292373
91177308-0d34-0410-b5e6-
96231b3b80d8
unsigned Kind = Fixup.getKind();
switch (Kind) {
default:
- llvm_unreachable("Unknown fixup kind!");
+ if (Ctx) Ctx->reportError(Fixup.getLoc(), "bad relocation fixup type");
+ return 0;
case FK_Data_1:
case FK_Data_2:
case FK_Data_4:
--- /dev/null
+@ RUN: not llvm-mc -triple arm-arm-none-eabi -filetype obj < %s -o /dev/null 2>&1 | FileCheck %s
+
+ .align 3
+symbol:
+ .quad(symbol)
+
+@ CHECK: error: bad relocation fixup type
+@ CHECK-NEXT: .quad(symbol)
+@ CHECK-NEXT: ^