[llvm-commits] [llvm] r158722 - in /llvm/trunk: lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp test/MC/ARM/elf-reloc-condcall.s
Jan Wen Voung
jvoung at google.com
Tue Jun 19 09:03:02 PDT 2012
Author: jvoung
Date: Tue Jun 19 11:03:02 2012
New Revision: 158722
URL: http://llvm.org/viewvc/llvm-project?rev=158722&view=rev
Log:
Have ARM ELF use correct reloc for "b" instr.
The condition code didn't actually matter for arm "b" instructions,
unlike "bl". It should just use the R_ARM_JUMP24 reloc.
Modified:
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
llvm/trunk/test/MC/ARM/elf-reloc-condcall.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=158722&r1=158721&r2=158722&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp Tue Jun 19 11:03:02 2012
@@ -178,9 +178,8 @@
break;
}
break;
- case ARM::fixup_arm_uncondbl:
case ARM::fixup_arm_blx:
- case ARM::fixup_arm_uncondbranch:
+ case ARM::fixup_arm_uncondbl:
switch (Modifier) {
case MCSymbolRefExpr::VK_ARM_PLT:
Type = ELF::R_ARM_PLT32;
@@ -192,6 +191,7 @@
break;
case ARM::fixup_arm_condbl:
case ARM::fixup_arm_condbranch:
+ case ARM::fixup_arm_uncondbranch:
Type = ELF::R_ARM_JUMP24;
break;
case ARM::fixup_arm_movt_hi16:
@@ -252,10 +252,8 @@
case ARM::fixup_arm_thumb_cp:
case ARM::fixup_arm_thumb_br:
llvm_unreachable("Unimplemented");
- case ARM::fixup_arm_uncondbranch:
- Type = ELF::R_ARM_CALL;
- break;
case ARM::fixup_arm_condbranch:
+ case ARM::fixup_arm_uncondbranch:
Type = ELF::R_ARM_JUMP24;
break;
case ARM::fixup_arm_movt_hi16:
Modified: llvm/trunk/test/MC/ARM/elf-reloc-condcall.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/elf-reloc-condcall.s?rev=158722&r1=158721&r2=158722&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/elf-reloc-condcall.s (original)
+++ llvm/trunk/test/MC/ARM/elf-reloc-condcall.s Tue Jun 19 11:03:02 2012
@@ -4,6 +4,8 @@
bleq some_label
bl some_label
blx some_label
+ beq some_label
+ b some_label
// OBJ: .rel.text
// OBJ: 'r_offset', 0x00000000
@@ -18,6 +20,14 @@
// OBJ-NEXT: 'r_sym', 0x000004
// OBJ-NEXT: 'r_type', 0x1c
+// OBJ: 'r_offset', 0x0000000c
+// OBJ-NEXT: 'r_sym', 0x000004
+// OBJ-NEXT: 'r_type', 0x1d
+
+// OBJ: 'r_offset', 0x00000010
+// OBJ-NEXT: 'r_sym', 0x000004
+// OBJ-NEXT: 'r_type', 0x1d
+
// OBJ: .symtab
// OBJ: Symbol 4
-// OBJ-NEXT: some_label
\ No newline at end of file
+// OBJ-NEXT: some_label
More information about the llvm-commits
mailing list