Skip to content

Commit f79cd71

Browse files
DimitryAndrictstellar
authored andcommitted
[arm] Add big-endian version of pcrel fixups for adr instructions
Summary: In 2e24219, a number of ARM pcrel fixups were resolved at assembly time, to solve PR44929. This only covered little-endian ARM however, so add similar fixups for big-endian ARM. Also extend the test case to cover big-endian ARM. Reviewers: hans, psmith, MaskRay Reviewed By: psmith, MaskRay Subscribers: kristof.beyls, hiraditya, danielkiss, emaste, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79774 (cherry picked from commit fc37352)
1 parent f3164f7 commit f79cd71

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp

+8-12
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,22 @@ const MCFixupKindInfo &ARMAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
116116
// ARMFixupKinds.h.
117117
//
118118
// Name Offset (bits) Size (bits) Flags
119-
{"fixup_arm_ldst_pcrel_12", 0, 32, MCFixupKindInfo::FKF_IsPCRel},
119+
{"fixup_arm_ldst_pcrel_12", 0, 32, IsPCRelConstant},
120120
{"fixup_t2_ldst_pcrel_12", 0, 32,
121-
MCFixupKindInfo::FKF_IsPCRel |
122-
MCFixupKindInfo::FKF_IsAlignedDownTo32Bits},
123-
{"fixup_arm_pcrel_10_unscaled", 0, 32, MCFixupKindInfo::FKF_IsPCRel},
124-
{"fixup_arm_pcrel_10", 0, 32, MCFixupKindInfo::FKF_IsPCRel},
121+
IsPCRelConstant | MCFixupKindInfo::FKF_IsAlignedDownTo32Bits},
122+
{"fixup_arm_pcrel_10_unscaled", 0, 32, IsPCRelConstant},
123+
{"fixup_arm_pcrel_10", 0, 32, IsPCRelConstant},
125124
{"fixup_t2_pcrel_10", 0, 32,
126125
MCFixupKindInfo::FKF_IsPCRel |
127126
MCFixupKindInfo::FKF_IsAlignedDownTo32Bits},
128127
{"fixup_arm_pcrel_9", 0, 32, MCFixupKindInfo::FKF_IsPCRel},
129128
{"fixup_t2_pcrel_9", 0, 32,
130-
MCFixupKindInfo::FKF_IsPCRel |
131-
MCFixupKindInfo::FKF_IsAlignedDownTo32Bits},
129+
IsPCRelConstant | MCFixupKindInfo::FKF_IsAlignedDownTo32Bits},
132130
{"fixup_thumb_adr_pcrel_10", 8, 8,
133-
MCFixupKindInfo::FKF_IsPCRel |
134-
MCFixupKindInfo::FKF_IsAlignedDownTo32Bits},
135-
{"fixup_arm_adr_pcrel_12", 0, 32, MCFixupKindInfo::FKF_IsPCRel},
131+
IsPCRelConstant | MCFixupKindInfo::FKF_IsAlignedDownTo32Bits},
132+
{"fixup_arm_adr_pcrel_12", 0, 32, IsPCRelConstant},
136133
{"fixup_t2_adr_pcrel_12", 0, 32,
137-
MCFixupKindInfo::FKF_IsPCRel |
138-
MCFixupKindInfo::FKF_IsAlignedDownTo32Bits},
134+
IsPCRelConstant | MCFixupKindInfo::FKF_IsAlignedDownTo32Bits},
139135
{"fixup_arm_condbranch", 8, 24, MCFixupKindInfo::FKF_IsPCRel},
140136
{"fixup_arm_uncondbranch", 8, 24, MCFixupKindInfo::FKF_IsPCRel},
141137
{"fixup_t2_condbranch", 0, 32, MCFixupKindInfo::FKF_IsPCRel},

llvm/test/MC/ARM/pcrel-global.s

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@ RUN: llvm-mc -filetype=obj -triple=armv7 %s -o %t
22
@ RUN: llvm-readelf -r %t | FileCheck %s
3+
@ RUN: llvm-mc -filetype=obj -triple=armebv7 %s -o %t
4+
@ RUN: llvm-readelf -r %t | FileCheck %s
35

46
@ CHECK: There are no relocations in this file.
57
.syntax unified

0 commit comments

Comments
 (0)