[llvm] r197282 - Fixed a bug in getARMFixupKindMachOInfo() where three ARM fixup kinds
Kevin Enderby
enderby at apple.com
Fri Dec 13 14:46:54 PST 2013
Author: enderby
Date: Fri Dec 13 16:46:54 2013
New Revision: 197282
URL: http://llvm.org/viewvc/llvm-project?rev=197282&view=rev
Log:
Fixed a bug in getARMFixupKindMachOInfo() where three ARM fixup kinds
were falling into the cases for 24-bit branch kinds which are not 24-bit
branches. The routine is to return false for fixups are expected to always
be resolvable at assembly time. Which these three fixups are as they have
limited displacement and are for local references within a function.
rdar://15586725
Added:
llvm/trunk/test/MC/MachO/ARM/bad-darwin-ARM-reloc.s
Modified:
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp?rev=197282&r1=197281&r2=197282&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp Fri Dec 13 16:46:54 2013
@@ -82,10 +82,14 @@ static bool getARMFixupKindMachOInfo(uns
Log2Size = llvm::Log2_32(8);
return true;
- // Handle 24-bit branch kinds.
+ // These fixups are expected to always be resolvable at assembly time and
+ // have no relocations supported.
case ARM::fixup_arm_ldst_pcrel_12:
case ARM::fixup_arm_pcrel_10:
case ARM::fixup_arm_adr_pcrel_12:
+ return false;
+
+ // Handle 24-bit branch kinds.
case ARM::fixup_arm_condbranch:
case ARM::fixup_arm_uncondbranch:
case ARM::fixup_arm_uncondbl:
Added: llvm/trunk/test/MC/MachO/ARM/bad-darwin-ARM-reloc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/ARM/bad-darwin-ARM-reloc.s?rev=197282&view=auto
==============================================================================
--- llvm/trunk/test/MC/MachO/ARM/bad-darwin-ARM-reloc.s (added)
+++ llvm/trunk/test/MC/MachO/ARM/bad-darwin-ARM-reloc.s Fri Dec 13 16:46:54 2013
@@ -0,0 +1,9 @@
+@ RUN: not llvm-mc -n -triple armv7-apple-darwin10 %s -filetype=obj -o - 2> %t.err > %t
+@ RUN: FileCheck --check-prefix=CHECK-ERROR < %t.err %s
+@ rdar://15586725
+.text
+ ldr r3, L___fcommon
+.section myseg, mysect
+L___fcommon:
+ .word 0
+@ CHECK-ERROR: unsupported relocation on symbol
More information about the llvm-commits
mailing list