Skip to content

Commit 5bd334a

Browse files
committedNov 5, 2018
[lld][NFC] Update tests to use -S instead of -s when using llvm-readelf.
Summary: llvm-readobj/readelf accepts both -s and -S as aliases for --sections. However with GNU readelf only -S means --section, and -s means --symbols. I would like to make llvm-readelf more compatible. Reviewers: MaskRay, espindola Reviewed By: MaskRay Subscribers: emaste, arichardson, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D54118 llvm-svn: 346164
1 parent 625984b commit 5bd334a

13 files changed

+15
-15
lines changed
 

‎lld/test/ELF/got32-i386-pie-rw.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# REQUIRES: x86
22
# RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o
33
# RUN: ld.lld %t.o -o %t -pie
4-
# RUN: llvm-readelf -r -s %t | FileCheck %s
4+
# RUN: llvm-readelf -r -S %t | FileCheck %s
55

66
# Unlike bfd and gold we accept this.
77

‎lld/test/ELF/linkerscript/align-r.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/align.s -o %t1.o
66
# RUN: ld.lld -r -o %t2.o --script %s %t1.o
7-
# RUN: llvm-readelf -s %t2.o | FileCheck %s
7+
# RUN: llvm-readelf -S %t2.o | FileCheck %s
88

99
# CHECK: Section Headers:
1010
# CHECK-NEXT: Name Type Address Off Size ES Flg Lk Inf Al

‎lld/test/ELF/linkerscript/non-alloc-segment.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# RUN: .foo : {*(.foo)} :foo \
1717
# RUN: }" > %t.script
1818
# RUN: ld.lld -o %t --script %t.script %t.o
19-
# RUN: llvm-readelf -s -l %t | FileCheck %s
19+
# RUN: llvm-readelf -S -l %t | FileCheck %s
2020
# RUN: llvm-readobj -l %t | FileCheck --check-prefix=PHDR %s
2121

2222
# CHECK: Program Headers:

‎lld/test/ELF/linkerscript/non-alloc.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# RUN: echo "SECTIONS { .foo 0 : {*(foo)} }" > %t.script
55
# RUN: ld.lld --hash-style=sysv -o %t --script %t.script %t.o -shared
6-
# RUN: llvm-readelf -s -l %t | FileCheck %s
6+
# RUN: llvm-readelf -S -l %t | FileCheck %s
77

88
# Test that we create all necessary PT_LOAD. We use to stop at the first
99
# non-alloc, causing us to not create PT_LOAD for linker generated sections.

‎lld/test/ELF/linkerscript/orphan-discard.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# RUN: /DISCARD/ : { *(.comment) } \
1111
# RUN: }" > %t.script
1212
# RUN: ld.lld -o %t --script %t.script %t.o
13-
# RUN: llvm-readelf -s -symbols %t | FileCheck %s
13+
# RUN: llvm-readelf -S -symbols %t | FileCheck %s
1414

1515
# CHECK: .bss NOBITS ffffffff80002000 002008 000002 00 WA 0 0 4096
1616
# CHECK: ffffffff80003000 0 NOTYPE GLOBAL DEFAULT 3 _end

‎lld/test/ELF/linkerscript/orphan-phdrs.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# RUN: .rw : { *(.rw) } \
1111
# RUN: }" > %t.script
1212
# RUN: ld.lld -o %t --script %t.script %t.o
13-
# RUN: llvm-readelf -s -l %t | FileCheck %s
13+
# RUN: llvm-readelf -S -l %t | FileCheck %s
1414

1515
## Check that the orphan section is placed correctly and belongs to
1616
## the correct segment.

‎lld/test/ELF/linkerscript/segment-none.s

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# RUN: .foo : {*(.foo)} :NONE \
1010
# RUN: }" > %t.script
1111
# RUN: ld.lld -o %t --script %t.script %t.o
12-
# RUN: llvm-readelf -s -l %t | FileCheck %s
12+
# RUN: llvm-readelf -S -l %t | FileCheck %s
1313

1414
## Test that section .foo is placed in segment NONE when assigned to segment
1515
## NONE in the linker script and segment NONE is defined.
@@ -19,7 +19,7 @@
1919
# RUN: .foo : {*(.foo)} :NONE \
2020
# RUN: }" > %t.script
2121
# RUN: ld.lld -o %t --script %t.script %t.o
22-
# RUN: llvm-readelf -s -l %t | FileCheck --check-prefix=DEFINED %s
22+
# RUN: llvm-readelf -S -l %t | FileCheck --check-prefix=DEFINED %s
2323

2424
# CHECK: Section to Segment mapping:
2525
# CHECK-NEXT: Segment Sections...

‎lld/test/ELF/linkerscript/sort-non-script.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# RUN: echo "SECTIONS { foo : {*(foo)} }" > %t.script
55
# RUN: ld.lld --hash-style=sysv -o %t --script %t.script %t.o -shared
6-
# RUN: llvm-readelf -s %t | FileCheck %s
6+
# RUN: llvm-readelf -S %t | FileCheck %s
77

88
# CHECK: .dynsym {{.*}} A
99
# CHECK-NEXT: .hash {{.*}} A

‎lld/test/ELF/linkerscript/unused-synthetic.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# RUN: }" > %t.script
88
# RUN: ld.lld -shared -o %t.so --script %t.script %t.o
99

10-
# RUN: llvm-readelf -s %t.so | FileCheck %s
10+
# RUN: llvm-readelf -S %t.so | FileCheck %s
1111
# CHECK-NOT: .got
1212
# CHECK-NOT: .plt
1313
# CHECK: .dynsym

‎lld/test/ELF/lto/section-name.ll

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
; REQUIRES: x86
22
; RUN: llvm-as %s -o %t.o
33
; RUN: ld.lld %t.o -o %t.so -shared
4-
; RUN: llvm-readelf -s %t.so | FileCheck %s
4+
; RUN: llvm-readelf -S %t.so | FileCheck %s
55
; RUN: ld.lld %t.o -o %t.so -shared --gc-sections
6-
; RUN: llvm-readelf -s %t.so | FileCheck --check-prefix=GC %s
6+
; RUN: llvm-readelf -S %t.so | FileCheck --check-prefix=GC %s
77

88
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
99
target triple = "x86_64-unknown-linux-gnu"

‎lld/test/ELF/sort-norosegment.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
33

44
# RUN: ld.lld --hash-style=sysv -no-rosegment -o %t %t.o -shared
5-
# RUN: llvm-readelf -s %t | FileCheck %s
5+
# RUN: llvm-readelf -S %t | FileCheck %s
66

77
# CHECK: .dynsym {{.*}} A
88
# CHECK-NEXT: .hash {{.*}} A

‎lld/test/ELF/x86-64-reloc-gotoff64.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// REQUIRES: x86
22
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
33
// RUN: ld.lld %t.o -shared -o %t.so
4-
// RUN: llvm-readelf -s %t.so | FileCheck %s -check-prefix=SECTION
4+
// RUN: llvm-readelf -S %t.so | FileCheck %s -check-prefix=SECTION
55
// RUN: llvm-objdump -d %t.so | FileCheck %s
66

77
// SECTION: .dynamic DYNAMIC 0000000000003000

‎lld/test/ELF/x86-64-reloc-gotpc64.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// REQUIRES: x86
22
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
33
// RUN: ld.lld %t.o -shared -o %t.so
4-
// RUN: llvm-readelf -s %t.so | FileCheck %s -check-prefix=SECTION
4+
// RUN: llvm-readelf -S %t.so | FileCheck %s -check-prefix=SECTION
55
// RUN: llvm-objdump -d %t.so | FileCheck %s
66

77
// SECTION: .got PROGBITS 0000000000003070 003070 000000

0 commit comments

Comments
 (0)
Please sign in to comment.