summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s2
-rw-r--r--llvm/test/MC/ELF/got-relaxed-no-relax.s2
-rw-r--r--llvm/test/MC/ELF/got-relaxed-rex.s2
-rw-r--r--llvm/test/MC/ELF/got-relaxed.s10
-rw-r--r--llvm/tools/llvm-mc/llvm-mc.cpp6
5 files changed, 15 insertions, 7 deletions
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s b/llvm/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s
index c0658307980..4eae72b18ca 100644
--- a/llvm/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s
+++ b/llvm/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s
@@ -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'
diff --git a/llvm/test/MC/ELF/got-relaxed-no-relax.s b/llvm/test/MC/ELF/got-relaxed-no-relax.s
index 008481a035a..69511cd78cd 100644
--- a/llvm/test/MC/ELF/got-relaxed-no-relax.s
+++ b/llvm/test/MC/ELF/got-relaxed-no-relax.s
@@ -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
diff --git a/llvm/test/MC/ELF/got-relaxed-rex.s b/llvm/test/MC/ELF/got-relaxed-rex.s
index 7ea3ba03f6a..d35afaab3e5 100644
--- a/llvm/test/MC/ELF/got-relaxed-rex.s
+++ b/llvm/test/MC/ELF/got-relaxed-rex.s
@@ -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
diff --git a/llvm/test/MC/ELF/got-relaxed.s b/llvm/test/MC/ELF/got-relaxed.s
index 89b22657ac6..c89e462095d 100644
--- a/llvm/test/MC/ELF/got-relaxed.s
+++ b/llvm/test/MC/ELF/got-relaxed.s
@@ -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: ]
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp
index d75e24f1d17..ad3a9d09e6e 100644
--- a/llvm/tools/llvm-mc/llvm-mc.cpp
+++ b/llvm/tools/llvm-mc/llvm-mc.cpp
@@ -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,
OpenPOWER on IntegriCloud