[llvm] r273014 - Change the default of -relax-relocations.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 17 10:04:56 PDT 2016
Author: rafael
Date: Fri Jun 17 12:04:56 2016
New Revision: 273014
URL: http://llvm.org/viewvc/llvm-project?rev=273014&view=rev
Log:
Change the default of -relax-relocations.
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.
Modified:
llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s
llvm/trunk/test/MC/ELF/got-relaxed-no-relax.s
llvm/trunk/test/MC/ELF/got-relaxed-rex.s
llvm/trunk/test/MC/ELF/got-relaxed.s
llvm/trunk/tools/llvm-mc/llvm-mc.cpp
Modified: llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s?rev=273014&r1=273013&r2=273014&view=diff
==============================================================================
--- llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s (original)
+++ llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s Fri Jun 17 12:04:56 2016
@@ -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'
Modified: llvm/trunk/test/MC/ELF/got-relaxed-no-relax.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/got-relaxed-no-relax.s?rev=273014&r1=273013&r2=273014&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/got-relaxed-no-relax.s (original)
+++ llvm/trunk/test/MC/ELF/got-relaxed-no-relax.s Fri Jun 17 12:04:56 2016
@@ -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
Modified: llvm/trunk/test/MC/ELF/got-relaxed-rex.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/got-relaxed-rex.s?rev=273014&r1=273013&r2=273014&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/got-relaxed-rex.s (original)
+++ llvm/trunk/test/MC/ELF/got-relaxed-rex.s Fri Jun 17 12:04:56 2016
@@ -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
Modified: llvm/trunk/test/MC/ELF/got-relaxed.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/got-relaxed.s?rev=273014&r1=273013&r2=273014&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/got-relaxed.s (original)
+++ llvm/trunk/test/MC/ELF/got-relaxed.s Fri Jun 17 12:04:56 2016
@@ -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
@@ -11,3 +12,10 @@
// 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: ]
Modified: llvm/trunk/tools/llvm-mc/llvm-mc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/llvm-mc.cpp?rev=273014&r1=273013&r2=273014&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/llvm-mc.cpp (original)
+++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp Fri Jun 17 12:04:56 2016
@@ -52,9 +52,9 @@ OutputFilename("o", cl::desc("Output fil
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,
More information about the llvm-commits
mailing list