[llvm] r273019 - Change RelaxELFRelocations for llc.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 17 10:43:41 PDT 2016


Author: rafael
Date: Fri Jun 17 12:43:41 2016
New Revision: 273019

URL: http://llvm.org/viewvc/llvm-project?rev=273019&view=rev
Log:
Change RelaxELFRelocations for llc.

As a developer tool it makes sense for it to use the new relocations.

Added:
    llvm/trunk/test/CodeGen/X86/relax-reloc.ll
Modified:
    llvm/trunk/include/llvm/Target/TargetOptions.h

Modified: llvm/trunk/include/llvm/Target/TargetOptions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=273019&r1=273018&r2=273019&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetOptions.h (original)
+++ llvm/trunk/include/llvm/Target/TargetOptions.h Fri Jun 17 12:43:41 2016
@@ -98,7 +98,7 @@ namespace llvm {
           GuaranteedTailCallOpt(false), StackAlignmentOverride(0),
           StackSymbolOrdering(true), EnableFastISel(false), UseInitArray(false),
           DisableIntegratedAS(false), CompressDebugSections(false),
-          RelaxELFRelocations(false), FunctionSections(false),
+          RelaxELFRelocations(true), FunctionSections(false),
           DataSections(false), UniqueSectionNames(true), TrapUnreachable(false),
           EmulatedTLS(false), FloatABIType(FloatABI::Default),
           AllowFPOpFusion(FPOpFusion::Standard), Reciprocals(TargetRecip()),

Added: llvm/trunk/test/CodeGen/X86/relax-reloc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/relax-reloc.ll?rev=273019&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/relax-reloc.ll (added)
+++ llvm/trunk/test/CodeGen/X86/relax-reloc.ll Fri Jun 17 12:43:41 2016
@@ -0,0 +1,15 @@
+; RUN: llc %s -o %t.o -filetype=obj -relocation-model=pic
+; RUN: llvm-readobj -r %t.o | FileCheck %s
+; CHECK:      Section ({{.}}) .rela.text {
+; CHECK-NEXT:   0x3 R_X86_64_REX_GOTPCRELX a 0xFFFFFFFFFFFFFFFC
+; CHECK-NEXT: }
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+ at a = external global i32
+
+define i32 @f() {
+  %t = load i32, i32* @a
+  ret i32 %t
+}




More information about the llvm-commits mailing list