[llvm-commits] [llvm] r147180 - in /llvm/trunk: lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp test/MC/ARM/elf-thumbfunc-reloc.s
Rafael Espindola
rafael.espindola at gmail.com
Thu Dec 22 13:36:43 PST 2011
Author: rafael
Date: Thu Dec 22 15:36:43 2011
New Revision: 147180
URL: http://llvm.org/viewvc/llvm-project?rev=147180&view=rev
Log:
Fix incorrect relocation generation. Patch by Kristof Beyls.
Fixes PR11214.
Added:
llvm/trunk/test/MC/ARM/elf-thumbfunc-reloc.s
Modified:
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
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=147180&r1=147179&r2=147180&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp Thu Dec 22 15:36:43 2011
@@ -209,14 +209,7 @@
break;
case ARM::fixup_arm_thumb_bl:
case ARM::fixup_arm_thumb_blx:
- switch (Modifier) {
- case MCSymbolRefExpr::VK_ARM_PLT:
- Type = ELF::R_ARM_THM_CALL;
- break;
- default:
- Type = ELF::R_ARM_NONE;
- break;
- }
+ Type = ELF::R_ARM_THM_CALL;
break;
}
} else {
Added: llvm/trunk/test/MC/ARM/elf-thumbfunc-reloc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/elf-thumbfunc-reloc.s?rev=147180&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/elf-thumbfunc-reloc.s (added)
+++ llvm/trunk/test/MC/ARM/elf-thumbfunc-reloc.s Thu Dec 22 15:36:43 2011
@@ -0,0 +1,23 @@
+@@ test st_value bit 0 of thumb function
+@ RUN: llvm-mc %s -triple=arm-freebsd-eabi -filetype=obj -o - | \
+@ RUN: elf-dump | FileCheck %s
+
+
+ .syntax unified
+ .text
+ .globl f
+ .align 2
+ .type f,%function
+ .code 16
+ .thumb_func
+f:
+ push {r7, lr}
+ mov r7, sp
+ bl g
+ pop {r7, pc}
+
+@@ make sure an R_ARM_THM_CALL relocation is generated for the call to g
+ at CHECK: ('_relocations', [
+ at CHECK: (('r_offset', 0x00000004)
+ at CHECK-NEXT: ('r_sym', 0x{{[0-9a-fA-F]+}})
+ at CHECK-NEXT: ('r_type', 0x0a)
More information about the llvm-commits
mailing list