[llvm] r364404 - [ARM] Handle fixup_arm_pcrel_9 correctly on big-endian targets

Mikhail Maltsev via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 26 03:48:40 PDT 2019


Author: miyuki
Date: Wed Jun 26 03:48:40 2019
New Revision: 364404

URL: http://llvm.org/viewvc/llvm-project?rev=364404&view=rev
Log:
[ARM] Handle fixup_arm_pcrel_9 correctly on big-endian targets

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

Added:
    llvm/trunk/test/MC/ARM/fixup-pcrel9.s
Modified:
    llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp

Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp?rev=364404&r1=364403&r2=364404&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Wed Jun 26 03:48:40 2019
@@ -1000,6 +1000,7 @@ static unsigned getFixupKindContainerSiz
   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:

Added: llvm/trunk/test/MC/ARM/fixup-pcrel9.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/fixup-pcrel9.s?rev=364404&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/fixup-pcrel9.s (added)
+++ llvm/trunk/test/MC/ARM/fixup-pcrel9.s Wed Jun 26 03:48:40 2019
@@ -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
+




More information about the llvm-commits mailing list