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

Add relocations for fixups fixup_arm_thumb_{br,bcc} #60

Merged
merged 1 commit into from
Dec 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target,
case ARM::fixup_t2_movw_lo16:
Type = ELF::R_ARM_THM_MOVW_PREL_NC;
break;
case ARM::fixup_arm_thumb_br:
Type = ELF::R_ARM_THM_JUMP11;
break;
case ARM::fixup_arm_thumb_bcc:
Type = ELF::R_ARM_THM_JUMP8;
break;
case ARM::fixup_arm_thumb_bl:
case ARM::fixup_arm_thumb_blx:
switch (Modifier) {
Expand Down
21 changes: 21 additions & 0 deletions test/MC/ARM/thumb1-branch-reloc.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@ RUN: llvm-mc -triple thumbv6-eabi -filetype obj -o - %s | llvm-readobj -r - \
@ RUN: | FileCheck %s

.syntax unified

.extern h
.section .text.uncond

b h

@CHECK: Section {{.*}} .rel.text.uncond {
@CHECK: 0x0 R_ARM_THM_JUMP11
@CHECK: }
.section .text.cond

ble h

@CHECK: Section {{.*}} .rel.text.cond {
@CHECK: 0x0 R_ARM_THM_JUMP8
@CHECK: }