Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit ceb177e

Browse files
authored
Merge pull request #60 from japaric/gh38406
Add relocations for fixups fixup_arm_thumb_{br,bcc}
2 parents d7342a9 + b966a9f commit ceb177e

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target,
140140
case ARM::fixup_t2_movw_lo16:
141141
Type = ELF::R_ARM_THM_MOVW_PREL_NC;
142142
break;
143+
case ARM::fixup_arm_thumb_br:
144+
Type = ELF::R_ARM_THM_JUMP11;
145+
break;
146+
case ARM::fixup_arm_thumb_bcc:
147+
Type = ELF::R_ARM_THM_JUMP8;
148+
break;
143149
case ARM::fixup_arm_thumb_bl:
144150
case ARM::fixup_arm_thumb_blx:
145151
switch (Modifier) {

test/MC/ARM/thumb1-branch-reloc.s

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@ RUN: llvm-mc -triple thumbv6-eabi -filetype obj -o - %s | llvm-readobj -r - \
2+
@ RUN: | FileCheck %s
3+
4+
.syntax unified
5+
6+
.extern h
7+
.section .text.uncond
8+
9+
b h
10+
11+
@CHECK: Section {{.*}} .rel.text.uncond {
12+
@CHECK: 0x0 R_ARM_THM_JUMP11
13+
@CHECK: }
14+
.section .text.cond
15+
16+
ble h
17+
18+
@CHECK: Section {{.*}} .rel.text.cond {
19+
@CHECK: 0x0 R_ARM_THM_JUMP8
20+
@CHECK: }
21+

0 commit comments

Comments
 (0)