]> granicus.if.org Git - llvm/commitdiff
Change the default of -relax-relocations.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 17 Jun 2016 17:04:56 +0000 (17:04 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 17 Jun 2016 17:04:56 +0000 (17:04 +0000)
llvm-mc is a developer tool, as such it make sense for it to use new
features by default.

This doesn't change the user facing clang, which still defaults to non
relaxable relocations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273014 91177308-0d34-0410-b5e6-96231b3b80d8

test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s
test/MC/ELF/got-relaxed-no-relax.s
test/MC/ELF/got-relaxed-rex.s
test/MC/ELF/got-relaxed.s
tools/llvm-mc/llvm-mc.cpp

index c0658307980f0b269f5d64c335d74962c04d7e27..4eae72b18ca47c99479a0ac415370d36309b10f5 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %T/file.o %p/Inputs/ELF_STT_FILE_GLOBAL.s
-# RUN: llvm-mc -triple=x86_64-pc-linux -relax-relocations -filetype=obj -o %T/relaxed.o %s
+# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj -o %T/relaxed.o %s
 # RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify %T/file.o %T/relaxed.o
 
 # Test that RTDyldELF does not crash with 'unimplemented relocation'
index 008481a035a7ee9d978f4ec499a4bef17e57f53b..69511cd78cd90a64a1d70b2b6c72294030909763 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -filetype=obj -relax-relocations -triple x86_64-pc-linux %s -o - | llvm-readobj -r | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o - | llvm-readobj -r | FileCheck %s
 
 // these should not produce relaxable relocations
 
index 7ea3ba03f6ada13c030be394dfe9b3a84d378d0c..d35afaab3e52fe592a13c6a0002b5bda361ed97e 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -filetype=obj -relax-relocations -triple x86_64-pc-linux %s -o - | llvm-readobj -r | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o - | llvm-readobj -r | FileCheck %s
 
 // these should produce R_X86_64_REX_GOTPCRELX
 
index 89b22657ac6092ddf80e09bad99f9fb99ebc6c12..c89e462095d80db59c8c1063a1390fe76a288375 100644 (file)
@@ -1,4 +1,5 @@
-// RUN: llvm-mc -filetype=obj -relax-relocations -triple x86_64-pc-linux %s -o - | llvm-readobj -r | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o - | llvm-readobj -r | FileCheck %s
+// RUN: llvm-mc -filetype=obj -relax-relocations=false -triple x86_64-pc-linux %s -o - | llvm-readobj -r | FileCheck --check-prefix=OLD %s
 
 // these should produce R_X86_64_GOTPCRELX
 
 // CHECK-NEXT:     R_X86_64_GOTPCRELX jmp
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]
+
+// OLD:      Relocations [
+// OLD-NEXT:   Section ({{.*}}) .rela.text {
+// OLD-NEXT:     R_X86_64_GOTPCREL call
+// OLD-NEXT:     R_X86_64_GOTPCREL jmp
+// OLD-NEXT:   }
+// OLD-NEXT: ]
index d75e24f1d173649029e1141ac5c1cfd91364f23e..ad3a9d09e6ec8be5cf72c240b254280250330f63 100644 (file)
@@ -52,9 +52,9 @@ OutputFilename("o", cl::desc("Output filename"),
 static cl::opt<bool>
 ShowEncoding("show-encoding", cl::desc("Show instruction encodings"));
 
-static cl::opt<bool>
-RelaxELFRel("relax-relocations", cl::init(false),
-  cl::desc("Emit R_X86_64_GOTPCRELX instead of R_X86_64_GOTPCREL"));
+static cl::opt<bool> RelaxELFRel(
+    "relax-relocations", cl::init(true),
+    cl::desc("Emit R_X86_64_GOTPCRELX instead of R_X86_64_GOTPCREL"));
 
 static cl::opt<DebugCompressionType>
 CompressDebugSections("compress-debug-sections", cl::ValueOptional,