Skip to content

Commit 2f1d79e

Browse files
committed
[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.
1 parent 00efb34 commit 2f1d79e

10 files changed

+13
-14
lines changed

lld/test/ELF/amdgpu-duplicate-sym.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# REQUIRES: amdgpu
2-
# RUN: llvm-mc -filetype=obj -triple amdgcn-amd-amdhsa -mcpu=gfx1031 --position-independent --relax-relocations %s -o %t.o
2+
# RUN: llvm-mc -filetype=obj -triple amdgcn-amd-amdhsa -mcpu=gfx1031 --position-independent %s -o %t.o
33

44
# We use lld-link on purpose to exercise -flavor.
55
# RUN: lld-link -flavor gnu -shared %t.o -o /dev/null

lld/test/ELF/i386-relax-reloc.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: x86
2-
// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o -relax-relocations
2+
// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o
33
// RUN: ld.lld -shared %t.o -o %t.so
44
// RUN: llvm-readelf -S %t.so | FileCheck --check-prefix=SEC %s
55
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck %s

lld/test/ELF/systemz-gotent-relax-align.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# REQUIRES: systemz
22
## Verify that R_390_GOTENT optimization is not performed on misaligned symbols.
33

4-
# RUN: llvm-mc -filetype=obj -relax-relocations -triple=s390x-unknown-linux %s -o %t.o
4+
# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %s -o %t.o
55
# RUN: ld.lld %t.o -o %t1
66
# RUN: llvm-readelf -S -r -x .got -x .got.plt %t1 | FileCheck --check-prefixes=CHECK %s
77
# RUN: llvm-objdump --no-print-imm-hex -d %t1 | FileCheck --check-prefix=DISASM %s

lld/test/ELF/systemz-gotent-relax-und-dso.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# REQUIRES: systemz
2-
# RUN: llvm-mc -filetype=obj -relax-relocations -triple=s390x-unknown-linux %s -o %t.o
3-
# RUN: llvm-mc -filetype=obj -relax-relocations -triple=s390x-unknown-linux %S/Inputs/gotpc-relax-und-dso.s -o %tdso.o
2+
# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %s -o %t.o
3+
# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %S/Inputs/gotpc-relax-und-dso.s -o %tdso.o
44
# RUN: ld.lld -shared %tdso.o -soname=t.so -o %t.so
55
# RUN: ld.lld --hash-style=sysv -shared %t.o %t.so -o %t
66
# RUN: llvm-readelf -r %t | FileCheck --check-prefix=RELOC %s

lld/test/ELF/systemz-gotent-relax.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# REQUIRES: systemz
22
## Test R_390_GOTENT optimization.
33

4-
# RUN: llvm-mc -filetype=obj -relax-relocations -triple=s390x-unknown-linux %s -o %t.o
4+
# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %s -o %t.o
55
# RUN: ld.lld %t.o -o %t1 --no-apply-dynamic-relocs
66
# RUN: llvm-readelf -S -r -x .got.plt %t1 | FileCheck --check-prefixes=CHECK,NOAPPLY %s
77
# RUN: ld.lld %t.o -o %t1 --apply-dynamic-relocs

lld/test/ELF/x86-64-gotpc-relax-nopic.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# REQUIRES: x86
2-
# RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-unknown-linux %s -o %t.o
2+
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
33
# RUN: ld.lld %t.o -o %t1
44
# RUN: llvm-readobj --symbols -r %t1 | FileCheck --check-prefix=SYMRELOC %s
55
# RUN: llvm-objdump -d --no-show-raw-insn --print-imm-hex %t1 | FileCheck --check-prefix=DISASM %s

lld/test/ELF/x86-64-gotpc-relax-und-dso.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# REQUIRES: x86
2-
# RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-unknown-linux %s -o %t.o
3-
# RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-pc-linux %S/Inputs/gotpc-relax-und-dso.s -o %tdso.o
2+
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3+
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/gotpc-relax-und-dso.s -o %tdso.o
44
# RUN: ld.lld -shared %tdso.o -soname=t.so -o %t.so
55
# RUN: ld.lld --hash-style=sysv -shared %t.o %t.so -o %t
66
# RUN: llvm-readobj -r -S %t | FileCheck --check-prefix=RELOC %s

lld/test/ELF/x86-64-gotpc-relax.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# REQUIRES: x86
22
## Test R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX GOT optimization.
33

4-
# RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-unknown-linux %s -o %t.o
4+
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
55
# RUN: ld.lld %t.o -o %t1 --no-apply-dynamic-relocs
66
# RUN: llvm-readelf -S -r -x .got.plt %t1 | FileCheck --check-prefixes=CHECK,NOAPPLY %s
77
# RUN: ld.lld %t.o -o %t1 --apply-dynamic-relocs

lld/test/ELF/x86-64-relax-got-abs.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Don't relax R_X86_64_GOTPCRELX to an absolute symbol.
44
## In -no-pie mode, it can be relaxed, but it may not worth it.
55

6-
# RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64 %s -o %t.o
6+
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
77
# RUN: ld.lld %t.o -o %t.so -shared
88
# RUN: llvm-objdump --no-print-imm-hex -d %t.so | FileCheck %s
99

lld/test/ELF/x86-64-relax-offset.s

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
/// Test we use input r_offset when deciding if R_X86_64_GOTPCRELX
44
/// relaxation is applicable.
55

6-
// RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-pc-linux %s \
7-
// RUN: -o %t.o
8-
// RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64-pc-linux \
6+
// RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
7+
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux \
98
// RUN: %p/Inputs/x86-64-relax-offset.s -o %t2.o
109
// RUN: ld.lld %t2.o %t.o -o %t.so -shared
1110
// RUN: llvm-objdump --no-print-imm-hex -d %t.so | FileCheck %s

0 commit comments

Comments
 (0)