[llvm] r252119 - Go back to producing relocations for out of range symbols.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 17:10:15 PST 2015


Author: rafael
Date: Wed Nov  4 19:10:15 2015
New Revision: 252119

URL: http://llvm.org/viewvc/llvm-project?rev=252119&view=rev
Log:
Go back to producing relocations for out of range symbols.

This brings back the behavior from before r252090 for out of range symbols.

Should bring some arm bots back.

Removed:
    llvm/trunk/test/MC/ARM/thumb-branches-err.s
Modified:
    llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
    llvm/trunk/test/MC/ARM/thumb-branches.s

Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp?rev=252119&r1=252118&r2=252119&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Wed Nov  4 19:10:15 2015
@@ -639,13 +639,11 @@ void ARMAsmBackend::processFixupValue(co
 
     // If the symbol is external the linker will handle it.
     // FIXME: Should we handle it as an optimization?
-    if (Sym->isExternal()) {
+
+    // If the symbol is out of range, produce a relocation and hope the
+    // linker can handle it. GNU AS produces an error in this case.
+    if (Sym->isExternal() || Value >= 0x400004)
       IsResolved = false;
-    } else {
-      if (Value >= 0x400004)
-        Asm.getContext().reportFatalError(Fixup.getLoc(),
-                                          "out of range for branch");
-    }
   }
   // We must always generate a relocation for BL/BLX instructions if we have
   // a symbol to reference, as the linker relies on knowing the destination

Removed: llvm/trunk/test/MC/ARM/thumb-branches-err.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/thumb-branches-err.s?rev=252118&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/thumb-branches-err.s (original)
+++ llvm/trunk/test/MC/ARM/thumb-branches-err.s (removed)
@@ -1,7 +0,0 @@
-@ RUN: not llvm-mc < %s -triple thumbv5-linux-gnueabi -filetype=obj -o %t 2>&1 | FileCheck %s
-
-        bl      end
-        .space 0x400000
-end:
-
-@ CHECK: out of range for branch

Modified: llvm/trunk/test/MC/ARM/thumb-branches.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/thumb-branches.s?rev=252119&r1=252118&r2=252119&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/thumb-branches.s (original)
+++ llvm/trunk/test/MC/ARM/thumb-branches.s Wed Nov  4 19:10:15 2015
@@ -16,5 +16,10 @@ end2:
         .global end3
 end3:
 
+        bl      end4
+        .space 0x400000
+end4:
+
 @ CHECK: 0x400003 R_ARM_THM_CALL end2 0x0
 @ CHECK: 0x800006 R_ARM_THM_CALL end3 0x0
+@ CHECK: 0xC0000A R_ARM_THM_CALL end4 0x0




More information about the llvm-commits mailing list