From: Rafael Espindola Date: Fri, 17 Jun 2016 17:43:41 +0000 (+0000) Subject: Change RelaxELFRelocations for llc. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bef5612dfd55fe4ea9c9b02b5c72c4438aecbb36;p=llvm Change RelaxELFRelocations for llc. As a developer tool it makes sense for it to use the new relocations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273019 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Target/TargetOptions.h b/include/llvm/Target/TargetOptions.h index 1de8a5baacc..508b5d940b5 100644 --- a/include/llvm/Target/TargetOptions.h +++ b/include/llvm/Target/TargetOptions.h @@ -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()), diff --git a/test/CodeGen/X86/relax-reloc.ll b/test/CodeGen/X86/relax-reloc.ll new file mode 100644 index 00000000000..aa55de0c7a7 --- /dev/null +++ b/test/CodeGen/X86/relax-reloc.ll @@ -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" + +@a = external global i32 + +define i32 @f() { + %t = load i32, i32* @a + ret i32 %t +}