[llvm] r263156 - ARM: Support relative references using the PREL31 symbol variant.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 10 11:30:18 PST 2016
Author: pcc
Date: Thu Mar 10 13:30:18 2016
New Revision: 263156
URL: http://llvm.org/viewvc/llvm-project?rev=263156&view=rev
Log:
ARM: Support relative references using the PREL31 symbol variant.
Differential Revision: http://reviews.llvm.org/D17937
Modified:
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
llvm/trunk/test/MC/ARM/symbol-variants.s
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp?rev=263156&r1=263155&r2=263156&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp Thu Mar 10 13:30:18 2016
@@ -98,6 +98,9 @@ unsigned ARMELFObjectWriter::GetRelocTyp
case MCSymbolRefExpr::VK_ARM_GOT_PREL:
Type = ELF::R_ARM_GOT_PREL;
break;
+ case MCSymbolRefExpr::VK_ARM_PREL31:
+ Type = ELF::R_ARM_PREL31;
+ break;
}
break;
case ARM::fixup_arm_blx:
Modified: llvm/trunk/test/MC/ARM/symbol-variants.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/symbol-variants.s?rev=263156&r1=263155&r2=263156&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/symbol-variants.s (original)
+++ llvm/trunk/test/MC/ARM/symbol-variants.s Thu Mar 10 13:30:18 2016
@@ -84,8 +84,14 @@ bl f05(plt)
@ CHECK: 60 R_ARM_TLS_GOTDESC f24
@ CHECK: 64 R_ARM_TLS_GOTDESC f25
+@ prel31 (relative)
+.word f26(PREL31)-.
+.word f27(prel31)-.
+ at CHECK: 68 R_ARM_PREL31 f26
+ at CHECK: 6c R_ARM_PREL31 f27
+
@ got_prel
-.word f26(GOT_PREL) + (. - .Lsym)
- ldr r3, =f27(GOT_PREL)
-@ CHECK: 68 R_ARM_GOT_PREL f26
-@ CHECK: 70 R_ARM_GOT_PREL f27
+.word f28(GOT_PREL) + (. - .Lsym)
+ ldr r3, =f29(GOT_PREL)
+@ CHECK: 70 R_ARM_GOT_PREL f28
+@ CHECK: 78 R_ARM_GOT_PREL f29
More information about the llvm-commits
mailing list