[lld] 2f1d79e - [ELF, test] Remove unneeded -relax-relocations from llvm-mc
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 22:50:41 PST 2024
Author: Fangrui Song
Date: 2024-03-06T22:50:37-08:00
New Revision: 2f1d79ee702148f452584367ddd0e3c81ecf3c64
URL: https://github.com/llvm/llvm-project/commit/2f1d79ee702148f452584367ddd0e3c81ecf3c64
DIFF: https://github.com/llvm/llvm-project/commit/2f1d79ee702148f452584367ddd0e3c81ecf3c64.diff
LOG: [ELF,test] Remove unneeded -relax-relocations from llvm-mc
This is option is x86-64 specific and should not be used by
AMDGPU/SystemZ. On x86-64, the option defaults to true and is
unnecessary.
Added:
Modified:
lld/test/ELF/amdgpu-duplicate-sym.s
lld/test/ELF/i386-relax-reloc.s
lld/test/ELF/systemz-gotent-relax-align.s
lld/test/ELF/systemz-gotent-relax-und-dso.s
lld/test/ELF/systemz-gotent-relax.s
lld/test/ELF/x86-64-gotpc-relax-nopic.s
lld/test/ELF/x86-64-gotpc-relax-und-dso.s
lld/test/ELF/x86-64-gotpc-relax.s
lld/test/ELF/x86-64-relax-got-abs.s
lld/test/ELF/x86-64-relax-offset.s
Removed:
################################################################################
diff --git a/lld/test/ELF/amdgpu-duplicate-sym.s b/lld/test/ELF/amdgpu-duplicate-sym.s
index db92dad01f6526..9423a2cee1d4ac 100644
--- a/lld/test/ELF/amdgpu-duplicate-sym.s
+++ b/lld/test/ELF/amdgpu-duplicate-sym.s
@@ -1,5 +1,5 @@
# REQUIRES: amdgpu
-# RUN: llvm-mc -filetype=obj -triple amdgcn-amd-amdhsa -mcpu=gfx1031 --position-independent --relax-relocations %s -o %t.o
+# RUN: llvm-mc -filetype=obj -triple amdgcn-amd-amdhsa -mcpu=gfx1031 --position-independent %s -o %t.o
# We use lld-link on purpose to exercise -flavor.
# RUN: lld-link -flavor gnu -shared %t.o -o /dev/null
diff --git a/lld/test/ELF/i386-relax-reloc.s b/lld/test/ELF/i386-relax-reloc.s
index 7376af7c8caa49..1db4939813702f 100644
--- a/lld/test/ELF/i386-relax-reloc.s
+++ b/lld/test/ELF/i386-relax-reloc.s
@@ -1,5 +1,5 @@
// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o -relax-relocations
+// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o
// RUN: ld.lld -shared %t.o -o %t.so
// RUN: llvm-readelf -S %t.so | FileCheck --check-prefix=SEC %s
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck %s
diff --git a/lld/test/ELF/systemz-gotent-relax-align.s b/lld/test/ELF/systemz-gotent-relax-align.s
index c6326086f56db0..125d74ba4a21e2 100644
--- a/lld/test/ELF/systemz-gotent-relax-align.s
+++ b/lld/test/ELF/systemz-gotent-relax-align.s
@@ -1,7 +1,7 @@
# REQUIRES: systemz
## Verify that R_390_GOTENT optimization is not performed on misaligned symbols.
-# RUN: llvm-mc -filetype=obj -relax-relocations -triple=s390x-unknown-linux %s -o %t.o
+# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -o %t1
# RUN: llvm-readelf -S -r -x .got -x .got.plt %t1 | FileCheck --check-prefixes=CHECK %s
# RUN: llvm-objdump --no-print-imm-hex -d %t1 | FileCheck --check-prefix=DISASM %s
diff --git a/lld/test/ELF/systemz-gotent-relax-und-dso.s b/lld/test/ELF/systemz-gotent-relax-und-dso.s
index 57369a417fd445..fdbda701dad123 100644
--- a/lld/test/ELF/systemz-gotent-relax-und-dso.s
+++ b/lld/test/ELF/systemz-gotent-relax-und-dso.s
@@ -1,6 +1,6 @@
# REQUIRES: systemz
-# RUN: llvm-mc -filetype=obj -relax-relocations -triple=s390x-unknown-linux %s -o %t.o
-# RUN: llvm-mc -filetype=obj -relax-relocations -triple=s390x-unknown-linux %S/Inputs/gotpc-relax-und-dso.s -o %tdso.o
+# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %s -o %t.o
+# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %S/Inputs/gotpc-relax-und-dso.s -o %tdso.o
# RUN: ld.lld -shared %tdso.o -soname=t.so -o %t.so
# RUN: ld.lld --hash-style=sysv -shared %t.o %t.so -o %t
# RUN: llvm-readelf -r %t | FileCheck --check-prefix=RELOC %s
diff --git a/lld/test/ELF/systemz-gotent-relax.s b/lld/test/ELF/systemz-gotent-relax.s
index f665e1af9e53d2..7ff82b9a190006 100644
--- a/lld/test/ELF/systemz-gotent-relax.s
+++ b/lld/test/ELF/systemz-gotent-relax.s
@@ -1,7 +1,7 @@
# REQUIRES: systemz
## Test R_390_GOTENT optimization.
-# RUN: llvm-mc -filetype=obj -relax-relocations -triple=s390x-unknown-linux %s -o %t.o
+# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -o %t1 --no-apply-dynamic-relocs
# RUN: llvm-readelf -S -r -x .got.plt %t1 | FileCheck --check-prefixes=CHECK,NOAPPLY %s
# RUN: ld.lld %t.o -o %t1 --apply-dynamic-relocs
diff --git a/lld/test/ELF/x86-64-gotpc-relax-nopic.s b/lld/test/ELF/x86-64-gotpc-relax-nopic.s
index cd12be86c7406a..7481904d16f1b4 100644
--- a/lld/test/ELF/x86-64-gotpc-relax-nopic.s
+++ b/lld/test/ELF/x86-64-gotpc-relax-nopic.s
@@ -1,5 +1,5 @@
# REQUIRES: x86
-# RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-unknown-linux %s -o %t.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -o %t1
# RUN: llvm-readobj --symbols -r %t1 | FileCheck --check-prefix=SYMRELOC %s
# RUN: llvm-objdump -d --no-show-raw-insn --print-imm-hex %t1 | FileCheck --check-prefix=DISASM %s
diff --git a/lld/test/ELF/x86-64-gotpc-relax-und-dso.s b/lld/test/ELF/x86-64-gotpc-relax-und-dso.s
index 0704d2c2c4aeda..329b1db8096310 100644
--- a/lld/test/ELF/x86-64-gotpc-relax-und-dso.s
+++ b/lld/test/ELF/x86-64-gotpc-relax-und-dso.s
@@ -1,6 +1,6 @@
# REQUIRES: x86
-# RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-unknown-linux %s -o %t.o
-# RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-pc-linux %S/Inputs/gotpc-relax-und-dso.s -o %tdso.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/gotpc-relax-und-dso.s -o %tdso.o
# RUN: ld.lld -shared %tdso.o -soname=t.so -o %t.so
# RUN: ld.lld --hash-style=sysv -shared %t.o %t.so -o %t
# RUN: llvm-readobj -r -S %t | FileCheck --check-prefix=RELOC %s
diff --git a/lld/test/ELF/x86-64-gotpc-relax.s b/lld/test/ELF/x86-64-gotpc-relax.s
index de858bffc07e39..5945bfc04a0225 100644
--- a/lld/test/ELF/x86-64-gotpc-relax.s
+++ b/lld/test/ELF/x86-64-gotpc-relax.s
@@ -1,7 +1,7 @@
# REQUIRES: x86
## Test R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX GOT optimization.
-# RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-unknown-linux %s -o %t.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -o %t1 --no-apply-dynamic-relocs
# RUN: llvm-readelf -S -r -x .got.plt %t1 | FileCheck --check-prefixes=CHECK,NOAPPLY %s
# RUN: ld.lld %t.o -o %t1 --apply-dynamic-relocs
diff --git a/lld/test/ELF/x86-64-relax-got-abs.s b/lld/test/ELF/x86-64-relax-got-abs.s
index 9af63ac33a4b14..b88e3ccd8a4259 100644
--- a/lld/test/ELF/x86-64-relax-got-abs.s
+++ b/lld/test/ELF/x86-64-relax-got-abs.s
@@ -3,7 +3,7 @@
## Don't relax R_X86_64_GOTPCRELX to an absolute symbol.
## In -no-pie mode, it can be relaxed, but it may not worth it.
-# RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64 %s -o %t.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
# RUN: ld.lld %t.o -o %t.so -shared
# RUN: llvm-objdump --no-print-imm-hex -d %t.so | FileCheck %s
diff --git a/lld/test/ELF/x86-64-relax-offset.s b/lld/test/ELF/x86-64-relax-offset.s
index 3858e153fd8685..09f6b47b693109 100644
--- a/lld/test/ELF/x86-64-relax-offset.s
+++ b/lld/test/ELF/x86-64-relax-offset.s
@@ -3,9 +3,8 @@
/// Test we use input r_offset when deciding if R_X86_64_GOTPCRELX
/// relaxation is applicable.
-// RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-pc-linux %s \
-// RUN: -o %t.o
-// RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-pc-linux \
+// RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux \
// RUN: %p/Inputs/x86-64-relax-offset.s -o %t2.o
// RUN: ld.lld %t2.o %t.o -o %t.so -shared
// RUN: llvm-objdump --no-print-imm-hex -d %t.so | FileCheck %s
More information about the llvm-commits
mailing list