]> granicus.if.org Git - llvm/commitdiff
[ARM] Handle fixup_arm_pcrel_9 correctly on big-endian targets
authorMikhail Maltsev <mikhail.maltsev@arm.com>
Wed, 26 Jun 2019 10:48:40 +0000 (10:48 +0000)
committerMikhail Maltsev <mikhail.maltsev@arm.com>
Wed, 26 Jun 2019 10:48:40 +0000 (10:48 +0000)
Summary:
The getFixupKindContainerSizeBytes function returns the size of the
instruction containing a given fixup. Currently fixup_arm_pcrel_9 is
not handled in this function, this causes an assertion failure in
the debug build and incorrect codegen in the release build.

This patch fixes the problem.

Reviewers: ostannard, simon_tatham

Reviewed By: ostannard

Subscribers: javed.absar, kristof.beyls, hiraditya, pbarrio, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63778

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364404 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
test/MC/ARM/fixup-pcrel9.s [new file with mode: 0644]

index a1eeeab2841fdca6f489ed25fb38185d3e739bb6..aeab5be78ab456f4039ef6c521939dd41387216d 100644 (file)
@@ -1000,6 +1000,7 @@ static unsigned getFixupKindContainerSizeBytes(unsigned Kind) {
   case ARM::fixup_arm_pcrel_10_unscaled:
   case ARM::fixup_arm_ldst_pcrel_12:
   case ARM::fixup_arm_pcrel_10:
+  case ARM::fixup_arm_pcrel_9:
   case ARM::fixup_arm_adr_pcrel_12:
   case ARM::fixup_arm_uncondbl:
   case ARM::fixup_arm_condbl:
diff --git a/test/MC/ARM/fixup-pcrel9.s b/test/MC/ARM/fixup-pcrel9.s
new file mode 100644 (file)
index 0000000..620b679
--- /dev/null
@@ -0,0 +1,18 @@
+// RUN: llvm-mc -triple=armebv8.2a-eabi -filetype=obj < %s | llvm-objdump -s - | FileCheck %s --check-prefix=CHECK-BE
+// RUN: llvm-mc -triple=armv8.2a-eabi -filetype=obj < %s | llvm-objdump -s - | FileCheck %s --check-prefix=CHECK-LE
+
+       .text
+       .fpu    crypto-neon-fp-armv8
+        .arch_extension fp16
+
+.section s_pcrel_9,"ax",%progbits
+// CHECK-BE-LABEL: Contents of section s_pcrel_9
+// CHECK-LE-LABEL: Contents of section s_pcrel_9
+// CHECK-BE: 0000 ed9f0902
+// CHECK-LE: 0000 02099fed
+       vldr.16 s0, .LCPI0_0
+        nop
+        bx lr
+.LCPI0_0:
+       .short  28012
+