[lld] 9e1319d - [llvm-readelf] Make --all output order closer to GNU readelf
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 4 12:22:22 PST 2020
Author: Fangrui Song
Date: 2020-03-04T12:22:12-08:00
New Revision: 9e1319df7e6508795e6f643c8b50306a5046d0b5
URL: https://github.com/llvm/llvm-project/commit/9e1319df7e6508795e6f643c8b50306a5046d0b5
DIFF: https://github.com/llvm/llvm-project/commit/9e1319df7e6508795e6f643c8b50306a5046d0b5.diff
LOG: [llvm-readelf] Make --all output order closer to GNU readelf
https://bugs.llvm.org/show_bug.cgi?id=43403
The new order makes it easy to compare the two tools' --all.
Reviewed By: grimar, rupprecht
Differential Revision: https://reviews.llvm.org/D75592
Added:
Modified:
lld/test/ELF/aarch64-gnu-ifunc-plt.s
lld/test/ELF/amdgpu-globals.s
lld/test/ELF/amdgpu-kernels.s
lld/test/ELF/apply-dynamic-relocs.s
lld/test/ELF/as-needed-no-reloc.s
lld/test/ELF/basic-aarch64.s
lld/test/ELF/basic-mips.s
lld/test/ELF/basic-sparcv9.s
lld/test/ELF/basic.s
lld/test/ELF/combreloc.s
lld/test/ELF/dynamic-got.s
lld/test/ELF/dynamic-reloc.s
lld/test/ELF/gc-sections-shared.s
lld/test/ELF/gnu-ifunc-dyntags.s
lld/test/ELF/gnu-ifunc-plt-i386.s
lld/test/ELF/gnu-ifunc-plt.s
lld/test/ELF/i386-tls-ie-shared.s
lld/test/ELF/init-fini.s
lld/test/ELF/linkerscript/symbol-only-align.test
lld/test/ELF/local-got-pie.s
lld/test/ELF/local-got-shared.s
lld/test/ELF/mips-26.s
lld/test/ELF/mips-32.s
lld/test/ELF/mips-64.s
lld/test/ELF/mips-dynamic.s
lld/test/ELF/mips-got-weak.s
lld/test/ELF/mips-options.s
lld/test/ELF/partition-exidx.s
lld/test/ELF/partition-pack-dyn-relocs.s
lld/test/ELF/partition-synthetic-sections.s
lld/test/ELF/ppc32-call-stub-nopic.s
lld/test/ELF/pre_init_fini_array.s
lld/test/ELF/relocation-copy-relro.s
lld/test/ELF/riscv-tls-ie.s
lld/test/ELF/shared.s
lld/test/ELF/tls.s
lld/test/ELF/verneed.s
lld/test/ELF/x86-64-gotpc-relax-nopic.s
lld/test/ELF/ztext.s
llvm/test/tools/llvm-objcopy/ELF/partitions.test
llvm/test/tools/llvm-readobj/ELF/all.test
llvm/test/tools/llvm-readobj/ELF/check-output-order.test
llvm/test/tools/llvm-readobj/ELF/dynamic-malformed.test
llvm/tools/llvm-readobj/llvm-readobj.cpp
Removed:
################################################################################
diff --git a/lld/test/ELF/aarch64-gnu-ifunc-plt.s b/lld/test/ELF/aarch64-gnu-ifunc-plt.s
index 91e812950d2f..d1a8eba40a95 100644
--- a/lld/test/ELF/aarch64-gnu-ifunc-plt.s
+++ b/lld/test/ELF/aarch64-gnu-ifunc-plt.s
@@ -5,7 +5,12 @@
// RUN: ld.lld --hash-style=sysv %t.so %t.o -o %tout
// RUN: llvm-objdump -d --no-show-raw-insn %tout | FileCheck %s --check-prefix=DISASM
// RUN: llvm-objdump -s %tout | FileCheck %s --check-prefix=GOTPLT
-// RUN: llvm-readobj -r --dynamic-table %tout | FileCheck %s
+// RUN: llvm-readobj --dynamic-table -r %tout | FileCheck %s
+
+// Check that the PLTRELSZ tag does not include the IRELATIVE relocations
+// CHECK: DynamicSection [
+// CHECK: 0x0000000000000008 RELASZ 48 (bytes)
+// CHECK: 0x0000000000000002 PLTRELSZ 48 (bytes)
// Check that the IRELATIVE relocations are after the JUMP_SLOT in the plt
// CHECK: Relocations [
@@ -26,11 +31,6 @@
// GOTPLT-NEXT: 230460 f0022100 00000000 00000000 00000000
// GOTPLT-NEXT: 230470 00000000 00000000
-// Check that the PLTRELSZ tag does not include the IRELATIVE relocations
-// CHECK: DynamicSection [
-// CHECK: 0x0000000000000008 RELASZ 48 (bytes)
-// CHECK: 0x0000000000000002 PLTRELSZ 48 (bytes)
-
// Check that a PLT header is written and the ifunc entries appear last
// DISASM: Disassembly of section .text:
// DISASM-EMPTY:
diff --git a/lld/test/ELF/amdgpu-globals.s b/lld/test/ELF/amdgpu-globals.s
index ed2637d0342a..603006604522 100644
--- a/lld/test/ELF/amdgpu-globals.s
+++ b/lld/test/ELF/amdgpu-globals.s
@@ -36,6 +36,11 @@ glob1:
# CHECK: Address: [[DATA_ADDR:[0-9xa-f]+]]
# CHECK: }
+# CHECK: ProgramHeader {
+# CHECK: Type: PT_LOAD
+# CHECK: ProgramHeader {
+# CHECK: Type: PT_LOAD
+
# CHECK: Symbol {
# CHECK: Name: glob0
# CHECK: Value: [[DATA_ADDR]]
@@ -51,13 +56,3 @@ glob1:
# CHECK: Type: Object
# CHECK: Section: .rodata
# CHECK: }
-
-# CHECK: ProgramHeader {
-# CHECK: Type: PT_LOAD
-# CHECK: VirtualAddress:
-# CHECK: }
-
-# CHECK: ProgramHeader {
-# CHECK: Type: PT_LOAD
-# CHECK: VirtualAddress:
-# CHECK: }
diff --git a/lld/test/ELF/amdgpu-kernels.s b/lld/test/ELF/amdgpu-kernels.s
index 65ca8497d8f5..90a5d26acd27 100644
--- a/lld/test/ELF/amdgpu-kernels.s
+++ b/lld/test/ELF/amdgpu-kernels.s
@@ -34,6 +34,9 @@ kernel1:
# CHECK: ]
# CHECK: }
+# CHECK: ProgramHeader {
+# CHECK: Type: PT_LOAD
+
# CHECK: Symbol {
# CHECK: Name: kernel0
# CHECK: Value:
@@ -51,8 +54,3 @@ kernel1:
# CHECK: Type: AMDGPU_HSA_KERNEL
# CHECK: Section: .text
# CHECK: }
-
-# CHECK: ProgramHeader {
-# CHECK: Type: PT_LOAD
-# CHECK: VirtualAddress:
-# CHECK: }
diff --git a/lld/test/ELF/apply-dynamic-relocs.s b/lld/test/ELF/apply-dynamic-relocs.s
index 232c0edbb911..3f91b15d79c9 100644
--- a/lld/test/ELF/apply-dynamic-relocs.s
+++ b/lld/test/ELF/apply-dynamic-relocs.s
@@ -4,10 +4,10 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: ld.lld %t.o -o %t.so -shared --apply-dynamic-relocs
-# RUN: llvm-readobj -r -S -l --section-data %t.so | FileCheck -check-prefixes=CHECK,APPLY %s
+# RUN: llvm-readobj -S --section-data -l -r %t.so | FileCheck -check-prefixes=CHECK,APPLY %s
# RUN: ld.lld %t.o -o %t2.so -shared
-# RUN: llvm-readobj -r -S -l --section-data %t2.so | FileCheck -check-prefixes=CHECK,NOAPPLY %s
+# RUN: llvm-readobj -S --section-data -l -r %t2.so | FileCheck -check-prefixes=CHECK,NOAPPLY %s
# RUN: ld.lld %t.o -o %t3.so -shared --no-apply-dynamic-relocs
# RUN: cmp %t2.so %t3.so
@@ -18,15 +18,15 @@
# NOAPPLY-NEXT: 0000: 00000000 00000000 |
# CHECK-NEXT: )
+# CHECK: Type: PT_DYNAMIC
+# CHECK-NEXT: Offset: 0x230
+# CHECK-NEXT: VirtualAddress: 0x[[DYNAMIC:.*]]
+# CHECK-NEXT: PhysicalAddress: 0x[[DYNAMIC]]
+
# CHECK: Relocations [
# CHECK-NEXT: Section ({{.*}}) .rela.dyn {
-# CHECK-NEXT: 0x[[GOT]] R_X86_64_RELATIVE - 0x[[ADDEND:.*]]
+# CHECK-NEXT: 0x[[GOT]] R_X86_64_RELATIVE - 0x[[DYNAMIC]]
# CHECK-NEXT: }
# CHECK-NEXT: ]
-# CHECK: Type: PT_DYNAMIC
-# CHECK-NEXT: Offset: 0x230
-# CHECK-NEXT: VirtualAddress: 0x[[ADDEND]]
-# CHECK-NEXT: PhysicalAddress: 0x[[ADDEND]]
-
cmpq $0, _DYNAMIC at GOTPCREL(%rip)
diff --git a/lld/test/ELF/as-needed-no-reloc.s b/lld/test/ELF/as-needed-no-reloc.s
index f8c34f80a595..6cedeec3155d 100644
--- a/lld/test/ELF/as-needed-no-reloc.s
+++ b/lld/test/ELF/as-needed-no-reloc.s
@@ -3,20 +3,13 @@
# RUN: ld.lld -shared %t2.o -o %t2.so
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: ld.lld -o %t %t.o --as-needed %t2.so
-# RUN: llvm-readobj --dynamic-table --dyn-symbols %t | FileCheck %s
+# RUN: llvm-readelf -d --dyn-symbols %t | FileCheck %s
# There must be a NEEDED entry for each undefined
-# CHECK: Name: bar
-# CHECK-NEXT: Value: 0x0
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Global
-# CHECK-NEXT: Type: Function
-# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: Undefined
-
-# CHECK: NEEDED Shared library: [{{.*}}as-needed-no-reloc{{.*}}2.so]
+# CHECK: (NEEDED) Shared library: [{{.*}}as-needed-no-reloc{{.*}}2.so]
+# CHECK: UND bar
.globl _start
_start:
diff --git a/lld/test/ELF/basic-aarch64.s b/lld/test/ELF/basic-aarch64.s
index 2e3e5da45f17..6b109e8da2c3 100644
--- a/lld/test/ELF/basic-aarch64.s
+++ b/lld/test/ELF/basic-aarch64.s
@@ -126,35 +126,6 @@ _start:
# CHECK-NEXT: EntrySize: 0
# CHECK-NEXT: }
# CHECK-NEXT: ]
-# CHECK-NEXT: Symbols [
-# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: (0)
-# CHECK-NEXT: Value: 0x0
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Local (0x0)
-# CHECK-NEXT: Type: None (0x0)
-# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: Undefined (0x0)
-# CHECK-NEXT: }
-# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: $x.0
-# CHECK-NEXT: Value: 0x210120
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Local (0x0)
-# CHECK-NEXT: Type: None (0x0)
-# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .text
-# CHECK-NEXT: }
-# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: _start
-# CHECK-NEXT: Value: [[ENTRY]]
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Global (0x1)
-# CHECK-NEXT: Type: None (0x0)
-# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .text
-# CHECK-NEXT: }
-# CHECK-NEXT: ]
# CHECK-NEXT: ProgramHeaders [
# CHECK-NEXT: ProgramHeader {
# CHECK-NEXT: Type: PT_PHDR (0x6)
@@ -207,3 +178,32 @@ _start:
# CHECK-NEXT: Alignment: 0
# CHECK-NEXT: }
# CHECK-NEXT: ]
+# CHECK-NEXT: Symbols [
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: (0)
+# CHECK-NEXT: Value: 0x0
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Local (0x0)
+# CHECK-NEXT: Type: None (0x0)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: Undefined (0x0)
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: $x.0
+# CHECK-NEXT: Value: 0x210120
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Local (0x0)
+# CHECK-NEXT: Type: None (0x0)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .text
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: _start
+# CHECK-NEXT: Value: [[ENTRY]]
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Global (0x1)
+# CHECK-NEXT: Type: None (0x0)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .text
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
diff --git a/lld/test/ELF/basic-mips.s b/lld/test/ELF/basic-mips.s
index dab4a3a6f917..454535ae95d4 100644
--- a/lld/test/ELF/basic-mips.s
+++ b/lld/test/ELF/basic-mips.s
@@ -208,37 +208,6 @@ __start:
# CHECK-NEXT: EntrySize: 0
# CHECK-NEXT: }
# CHECK-NEXT: ]
-# CHECK-NEXT: Symbols [
-# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: (0)
-# CHECK-NEXT: Value: 0x0
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Local (0x0)
-# CHECK-NEXT: Type: None (0x0)
-# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: Undefined (0x0)
-# CHECK-NEXT: }
-# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: _gp
-# CHECK-NEXT: Value: 0x38150
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Local
-# CHECK-NEXT: Type: None (0x0)
-# CHECK-NEXT: Other [ (0x2)
-# CHECK-NEXT: STV_HIDDEN (0x2)
-# CHECK-NEXT: ]
-# CHECK-NEXT: Section: .got
-# CHECK-NEXT: }
-# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: __start
-# CHECK-NEXT: Value: 0x20150
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Global (0x1)
-# CHECK-NEXT: Type: None (0x0)
-# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .text
-# CHECK-NEXT: }
-# CHECK-NEXT: ]
# CHECK-NEXT: ProgramHeaders [
# CHECK-NEXT: ProgramHeader {
# CHECK-NEXT: Type: PT_PHDR (0x6)
@@ -328,3 +297,34 @@ __start:
# CHECK-NEXT: Alignment: 8
# CHECK-NEXT: }
# CHECK-NEXT: ]
+# CHECK-NEXT: Symbols [
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: (0)
+# CHECK-NEXT: Value: 0x0
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Local (0x0)
+# CHECK-NEXT: Type: None (0x0)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: Undefined (0x0)
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: _gp
+# CHECK-NEXT: Value: 0x38150
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Local
+# CHECK-NEXT: Type: None (0x0)
+# CHECK-NEXT: Other [ (0x2)
+# CHECK-NEXT: STV_HIDDEN (0x2)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Section: .got
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: __start
+# CHECK-NEXT: Value: 0x20150
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Global (0x1)
+# CHECK-NEXT: Type: None (0x0)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .text
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
diff --git a/lld/test/ELF/basic-sparcv9.s b/lld/test/ELF/basic-sparcv9.s
index 43f3670ea6ce..af63dc47ae84 100644
--- a/lld/test/ELF/basic-sparcv9.s
+++ b/lld/test/ELF/basic-sparcv9.s
@@ -126,26 +126,6 @@ _start:
# CHECK-NEXT: EntrySize: 0
# CHECK-NEXT: }
# CHECK-NEXT: ]
-# CHECK-NEXT: Symbols [
-# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: (0)
-# CHECK-NEXT: Value: 0x0
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Local (0x0)
-# CHECK-NEXT: Type: None (0x0)
-# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: Undefined (0x0)
-# CHECK-NEXT: }
-# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: _start
-# CHECK-NEXT: Value: [[ENTRY]]
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Global (0x1)
-# CHECK-NEXT: Type: None (0x0)
-# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .text
-# CHECK-NEXT: }
-# CHECK-NEXT: ]
# CHECK-NEXT: ProgramHeaders [
# CHECK-NEXT: ProgramHeader {
# CHECK-NEXT: Type: PT_PHDR (0x6)
@@ -198,3 +178,23 @@ _start:
# CHECK-NEXT: Alignment: 0
# CHECK-NEXT: }
# CHECK-NEXT: ]
+# CHECK-NEXT: Symbols [
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: (0)
+# CHECK-NEXT: Value: 0x0
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Local (0x0)
+# CHECK-NEXT: Type: None (0x0)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: Undefined (0x0)
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: _start
+# CHECK-NEXT: Value: [[ENTRY]]
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Global (0x1)
+# CHECK-NEXT: Type: None (0x0)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .text
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
diff --git a/lld/test/ELF/basic.s b/lld/test/ELF/basic.s
index 7ed0ec624d7a..b0509a2dc123 100644
--- a/lld/test/ELF/basic.s
+++ b/lld/test/ELF/basic.s
@@ -128,26 +128,6 @@ _start:
# CHECK-NEXT: EntrySize: 0
# CHECK-NEXT: }
# CHECK-NEXT: ]
-# CHECK-NEXT: Symbols [
-# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: (0)
-# CHECK-NEXT: Value: 0x0
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Local (0x0)
-# CHECK-NEXT: Type: None (0x0)
-# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: Undefined (0x0)
-# CHECK-NEXT: }
-# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: _start
-# CHECK-NEXT: Value: [[ENTRY]]
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Global (0x1)
-# CHECK-NEXT: Type: None (0x0)
-# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .text
-# CHECK-NEXT: }
-# CHECK-NEXT: ]
# CHECK-NEXT: ProgramHeaders [
# CHECK-NEXT: ProgramHeader {
# CHECK-NEXT: Type: PT_PHDR (0x6)
@@ -200,6 +180,26 @@ _start:
# CHECK-NEXT: Alignment: 0
# CHECK-NEXT: }
# CHECK-NEXT: ]
+# CHECK-NEXT: Symbols [
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: (0)
+# CHECK-NEXT: Value: 0x0
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Local (0x0)
+# CHECK-NEXT: Type: None (0x0)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: Undefined (0x0)
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: _start
+# CHECK-NEXT: Value: [[ENTRY]]
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Global (0x1)
+# CHECK-NEXT: Type: None (0x0)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .text
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
# Test for the response file (POSIX quoting style)
# RUN: echo " -o %t2" > %t.responsefile
diff --git a/lld/test/ELF/combreloc.s b/lld/test/ELF/combreloc.s
index 8ecd1af1ce95..b3fc252f5971 100644
--- a/lld/test/ELF/combreloc.s
+++ b/lld/test/ELF/combreloc.s
@@ -12,6 +12,8 @@
# and emit DT_RELACOUNT (except on MIPS) to indicate the number of relative
# relocations.
+# CHECK: DynamicSection [
+# CHECK: RELACOUNT 1
# CHECK: Relocations [
# CHECK-NEXT: Section ({{.*}}) .rela.dyn {
# CHECK-NEXT: 0x3428 R_X86_64_RELATIVE - 0x3430
@@ -21,12 +23,12 @@
# CHECK-NEXT: 0x3418 R_X86_64_64 bbb 0x0
# CHECK-NEXT: 0x3410 R_X86_64_64 ccc 0x0
# CHECK-NEXT: }
-# CHECK: DynamicSection [
-# CHECK: RELACOUNT 1
# RUN: ld.lld -z nocombreloc -shared %t.o %t1.o -o %t.so
# RUN: llvm-readobj -r --dynamic-table %t.so | FileCheck --check-prefix=NOCOMB %s
+# NOCOMB: DynamicSection [
+# NOCOMB-NOT: RELACOUNT
# NOCOMB: Relocations [
# NOCOMB-NEXT: Section ({{.*}}) .rela.dyn {
# NOCOMB-NEXT: 0x33F8 R_X86_64_64 aaa 0x0
@@ -36,8 +38,6 @@
# NOCOMB-NEXT: 0x3418 R_X86_64_RELATIVE - 0x3420
# NOCOMB-NEXT: 0x23F0 R_X86_64_GLOB_DAT aaa 0x0
# NOCOMB-NEXT: }
-# NOCOMB: DynamicSection [
-# NOCOMB-NOT: RELACOUNT
.data
.quad aaa
diff --git a/lld/test/ELF/dynamic-got.s b/lld/test/ELF/dynamic-got.s
index 42f942df54da..2f68ea703eab 100644
--- a/lld/test/ELF/dynamic-got.s
+++ b/lld/test/ELF/dynamic-got.s
@@ -37,17 +37,17 @@
// CHECK-NEXT: 0000: 74210000 00000000 00000000
// CHECK-NEXT: )
+// CHECK: Type: PT_DYNAMIC
+// CHECK-NEXT: Offset: 0x174
+// CHECK-NEXT: VirtualAddress: 0x2174
+// CHECK-NEXT: PhysicalAddress: 0x2174
+
// CHECK: Relocations [
// CHECK-NEXT: Section ({{.*}}) .rel.dyn {
// CHECK-NEXT: 0x21C4 R_386_RELATIVE - 0x0
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK: Type: PT_DYNAMIC
-// CHECK-NEXT: Offset: 0x174
-// CHECK-NEXT: VirtualAddress: 0x2174
-// CHECK-NEXT: PhysicalAddress: 0x2174
-
calll .L0$pb
.L0$pb:
popl %eax
diff --git a/lld/test/ELF/dynamic-reloc.s b/lld/test/ELF/dynamic-reloc.s
index 52e55ea9326d..f6cb15e493dc 100644
--- a/lld/test/ELF/dynamic-reloc.s
+++ b/lld/test/ELF/dynamic-reloc.s
@@ -4,7 +4,7 @@
// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/dynamic-reloc.s -o %t3.o
// RUN: ld.lld -shared %t2.o -soname=so -o %t2.so
// RUN: ld.lld %t.o %t3.o %t2.so -o %t
-// RUN: llvm-readobj --dynamic-table -r --expand-relocs -S %t | FileCheck %s
+// RUN: llvm-readobj --dynamic-table -r -S %t | FileCheck %s
// CHECK: Index: 1
// CHECK-NEXT: Name: .dynsym
@@ -29,17 +29,6 @@
// CHECK-NEXT: SHF_EXECINSTR
// CHECK-NEXT: ]
-// CHECK: Relocations [
-// CHECK-NEXT: Section ({{.*}}) .rela.plt {
-// CHECK-NEXT: Relocation {
-// CHECK-NEXT: Offset:
-// CHECK-NEXT: Type: R_X86_64_JUMP_SLOT
-// CHECK-NEXT: Symbol: bar
-// CHECK-NEXT: Addend: 0x0
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-
// CHECK: DynamicSection [
// CHECK-NEXT: Tag Type Name/Value
// CHECK-NEXT: 0x0000000000000001 NEEDED Shared library: [so]
@@ -57,6 +46,12 @@
// CHECK-NEXT: 0x0000000000000000 NULL 0x0
// CHECK-NEXT: ]
+// CHECK: Relocations [
+// CHECK-NEXT: Section ({{.*}}) .rela.plt {
+// CHECK-NEXT: R_X86_64_JUMP_SLOT bar 0x0
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+
.global _start
_start:
.quad bar + 0x42
diff --git a/lld/test/ELF/gc-sections-shared.s b/lld/test/ELF/gc-sections-shared.s
index c0ebf403a333..8ef5bc0253e3 100644
--- a/lld/test/ELF/gc-sections-shared.s
+++ b/lld/test/ELF/gc-sections-shared.s
@@ -14,6 +14,10 @@
# At the same time, weak symbols should not cause adding DT_NEEDED;
# this case is checked with symbol qux and %t4.so.
+# CHECK-NOT: NEEDED
+# CHECK: NEEDED Shared library: [{{.*}}3.so]
+# CHECK-NOT: NEEDED
+
# CHECK: DynamicSymbols [
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name:
@@ -62,10 +66,6 @@
# CHECK-NEXT: }
# CHECK-NEXT: ]
-# CHECK-NOT: NEEDED
-# CHECK: NEEDED Shared library: [{{.*}}3.so]
-# CHECK-NOT: NEEDED
-
# Test with %t.o at the end too.
# RUN: ld.lld --gc-sections --export-dynamic-symbol foo -o %t --as-needed %t2.so %t3.so %t4.so %t.o
# RUN: llvm-readobj --dynamic-table --dyn-symbols %t | FileCheck --check-prefix=CHECK %s
diff --git a/lld/test/ELF/gnu-ifunc-dyntags.s b/lld/test/ELF/gnu-ifunc-dyntags.s
index 186a7a78ed64..1b5eb1b3dde3 100644
--- a/lld/test/ELF/gnu-ifunc-dyntags.s
+++ b/lld/test/ELF/gnu-ifunc-dyntags.s
@@ -11,13 +11,6 @@
# CHECK: .rela.dyn 00000030 0000000000000248
# CHECK: .got.plt 00000010 00000000000033a0
-# TAGS: Relocations [
-# TAGS-NEXT: Section {{.*}} .rela.dyn {
-# TAGS-NEXT: R_X86_64_IRELATIVE
-# TAGS-NEXT: R_X86_64_IRELATIVE
-# TAGS-NEXT: }
-# TAGS-NEXT: ]
-
# TAGS: Tag Type Name/Value
# TAGS: 0x0000000000000007 RELA 0x248
# TAGS: 0x0000000000000008 RELASZ 48 (bytes)
@@ -26,6 +19,13 @@
# TAGS: 0x0000000000000003 PLTGOT 0x33A0
# TAGS: 0x0000000000000014 PLTREL RELA
+# TAGS: Relocations [
+# TAGS-NEXT: Section {{.*}} .rela.dyn {
+# TAGS-NEXT: R_X86_64_IRELATIVE
+# TAGS-NEXT: R_X86_64_IRELATIVE
+# TAGS-NEXT: }
+# TAGS-NEXT: ]
+
.text
.type foo STT_GNU_IFUNC
.globl foo
diff --git a/lld/test/ELF/gnu-ifunc-plt-i386.s b/lld/test/ELF/gnu-ifunc-plt-i386.s
index 5d942359ce01..239a95457478 100644
--- a/lld/test/ELF/gnu-ifunc-plt-i386.s
+++ b/lld/test/ELF/gnu-ifunc-plt-i386.s
@@ -7,6 +7,11 @@
// RUN: llvm-objdump -s %tout | FileCheck %s --check-prefix=GOTPLT
// RUN: llvm-readobj -r --dynamic-table %tout | FileCheck %s
+/// Check that the PLTRELSZ tag does not include the IRELATIVE relocations
+// CHECK: DynamicSection [
+// CHECK: 0x00000012 RELSZ 16 (bytes)
+// CHECK: 0x00000002 PLTRELSZ 16 (bytes)
+
// Check that the IRELATIVE relocations are after the JUMP_SLOT in the plt
// CHECK: Relocations [
// CHECK-NEXT: Section (4) .rel.dyn {
@@ -24,11 +29,6 @@
// GOTPLT: 403298 20224000 00000000 00000000 e6114000
// GOTPLT-NEXT: 4032a8 f6114000 b4114000 b5114000
-// Check that the PLTRELSZ tag does not include the IRELATIVE relocations
-// CHECK: DynamicSection [
-// CHECK: 0x00000012 RELSZ 16 (bytes)
-// CHECK: 0x00000002 PLTRELSZ 16 (bytes)
-
// Check that a PLT header is written and the ifunc entries appear last
// DISASM: Disassembly of section .text:
// DISASM-EMPTY:
diff --git a/lld/test/ELF/gnu-ifunc-plt.s b/lld/test/ELF/gnu-ifunc-plt.s
index 3d0cec038a9c..41c0a3d6ebce 100644
--- a/lld/test/ELF/gnu-ifunc-plt.s
+++ b/lld/test/ELF/gnu-ifunc-plt.s
@@ -10,6 +10,11 @@
// RUN: llvm-objdump -s %tout | FileCheck %s --check-prefix=GOTPLT
// RUN: llvm-readobj -r --dynamic-table %tout | FileCheck %s
+/// Check that the PLTRELSZ tag does not include the IRELATIVE relocations
+// CHECK: DynamicSection [
+// CHECK: 0x0000000000000008 RELASZ 48 (bytes)
+// CHECK: 0x0000000000000002 PLTRELSZ 48 (bytes)
+
// Check that the IRELATIVE relocations are after the JUMP_SLOT in the plt
// CHECK: Relocations [
// CHECK-NEXT: Section (4) .rela.dyn {
@@ -28,11 +33,6 @@
// GOTPLT-NEXT: 203450 16132000 00000000 00000000 00000000
// GOTPLT-NEXT: 203460 00000000 00000000
-// Check that the PLTRELSZ tag does not include the IRELATIVE relocations
-// CHECK: DynamicSection [
-// CHECK: 0x0000000000000008 RELASZ 48 (bytes)
-// CHECK: 0x0000000000000002 PLTRELSZ 48 (bytes)
-
// Check that a PLT header is written and the ifunc entries appear last
// DISASM: Disassembly of section .text:
// DISASM-EMPTY:
diff --git a/lld/test/ELF/i386-tls-ie-shared.s b/lld/test/ELF/i386-tls-ie-shared.s
index ec238b260998..e8e507881cbf 100644
--- a/lld/test/ELF/i386-tls-ie-shared.s
+++ b/lld/test/ELF/i386-tls-ie-shared.s
@@ -21,6 +21,7 @@
// GOTRELSHARED-NEXT: AddressAlignment: 4
// GOTRELSHARED-NEXT: EntrySize: 0
// GOTRELSHARED-NEXT: }
+// GOTRELSHARED: 0x6FFFFFFA RELCOUNT 8
// GOTRELSHARED: Relocations [
// GOTRELSHARED-NEXT: Section ({{.*}}) .rel.dyn {
// GOTRELSHARED-NEXT: 0x22DA R_386_RELATIVE - 0x0
@@ -37,7 +38,6 @@
// GOTRELSHARED-NEXT: 0x338C R_386_TLS_TPOFF tlslocal1 0x0
// GOTRELSHARED-NEXT: }
// GOTRELSHARED-NEXT: ]
-// GOTRELSHARED: 0x6FFFFFFA RELCOUNT 8
// DISASMSHARED: Disassembly of section test:
// DISASMSHARED-EMPTY:
diff --git a/lld/test/ELF/init-fini.s b/lld/test/ELF/init-fini.s
index 7979e669f159..40aa98e95ceb 100644
--- a/lld/test/ELF/init-fini.s
+++ b/lld/test/ELF/init-fini.s
@@ -38,13 +38,13 @@
// and should not require given symbols to be resolved
// RUN: ld.lld -shared %t -o %t2 -init=_unknown -fini=_unknown
// RUN: llvm-readobj --symbols --dynamic-table %t2 | FileCheck --check-prefix=NOENTRY %s
-// NOENTRY: Symbols [
-// NOENTRY-NOT: Name: _unknown
-// NOENTRY: ]
// NOENTRY: DynamicSection [
// NOENTRY-NOT: INIT
// NOENTRY-NOT: FINI
// NOENTRY: ]
+// NOENTRY: Symbols [
+// NOENTRY-NOT: Name: _unknown
+// NOENTRY: ]
.global _start,_init,_fini,_foo,_bar,_undef
_start:
diff --git a/lld/test/ELF/linkerscript/symbol-only-align.test b/lld/test/ELF/linkerscript/symbol-only-align.test
index 24da737a6500..f4ecf275ec0b 100644
--- a/lld/test/ELF/linkerscript/symbol-only-align.test
+++ b/lld/test/ELF/linkerscript/symbol-only-align.test
@@ -26,10 +26,10 @@ SECTIONS {
# CHECK: foo PROGBITS 0000000000[[ADDR:[0-9a-f]*]] [[ADDR]]
# CHECK-NEXT: .data PROGBITS 0000000000[[ADDR]] [[ADDR]]
-# CHECK: Symbol table
-# CHECK: 0000000000[[ADDR]] 0 NOTYPE GLOBAL DEFAULT {{[0-9]+}} __start_foo
-# CHECK: 0000000000[[ADDR]] 0 NOTYPE GLOBAL DEFAULT {{[0-9]+}} __end_foo
-
# CHECK: Program Headers
# CHECK: LOAD
# CHECK-NEXT: LOAD 0x[[ADDR]] 0x0000000000[[ADDR]] 0x0000000000[[ADDR]]
+
+# CHECK: Symbol table
+# CHECK: 0000000000[[ADDR]] 0 NOTYPE GLOBAL DEFAULT {{[0-9]+}} __start_foo
+# CHECK: 0000000000[[ADDR]] 0 NOTYPE GLOBAL DEFAULT {{[0-9]+}} __end_foo
diff --git a/lld/test/ELF/local-got-pie.s b/lld/test/ELF/local-got-pie.s
index b2a81a64f503..794198c5c420 100644
--- a/lld/test/ELF/local-got-pie.s
+++ b/lld/test/ELF/local-got-pie.s
@@ -1,7 +1,7 @@
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
// RUN: ld.lld --hash-style=sysv %t.o -o %t -pie
-// RUN: llvm-readobj -S -r -d %t | FileCheck %s
+// RUN: llvm-readobj -S -d -r %t | FileCheck %s
// RUN: llvm-objdump -d %t | FileCheck --check-prefix=DISASM %s
.globl _start
@@ -31,9 +31,10 @@ foo:
// CHECK-NEXT: Offset:
// CHECK-NEXT: Size: 8
+// CHECK: 0x000000006FFFFFF9 RELACOUNT 1
+
// CHECK: Relocations [
// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
// CHECK-NEXT: 0x22C8 R_X86_64_RELATIVE - 0x1215
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK: 0x000000006FFFFFF9 RELACOUNT 1
diff --git a/lld/test/ELF/local-got-shared.s b/lld/test/ELF/local-got-shared.s
index 979b282972e5..13a7cc775a88 100644
--- a/lld/test/ELF/local-got-shared.s
+++ b/lld/test/ELF/local-got-shared.s
@@ -1,7 +1,7 @@
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
// RUN: ld.lld %t.o -o %t -shared
-// RUN: llvm-readobj -S -r -d %t | FileCheck %s
+// RUN: llvm-readobj -S -d -r %t | FileCheck %s
// RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefix=DISASM %s
bar:
@@ -29,9 +29,10 @@ foo:
// CHECK-NEXT: Offset:
// CHECK-NEXT: Size: 8
+// CHECK: 0x000000006FFFFFF9 RELACOUNT 1
+
// CHECK: Relocations [
// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
// CHECK-NEXT: 0x22E0 R_X86_64_RELATIVE - 0x122D
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK: 0x000000006FFFFFF9 RELACOUNT 1
diff --git a/lld/test/ELF/mips-26.s b/lld/test/ELF/mips-26.s
index 6d8cde47de03..fa747cd65049 100644
--- a/lld/test/ELF/mips-26.s
+++ b/lld/test/ELF/mips-26.s
@@ -7,7 +7,7 @@
# RUN: ld.lld %t2.o -shared -o %t.so
# RUN: ld.lld %t1.o %t.so -o %t.exe
# RUN: llvm-objdump -d --no-show-raw-insn --print-imm-hex %t.exe | FileCheck %s
-# RUN: llvm-readobj --dynamic-table -S -r -A %t.exe \
+# RUN: llvm-readobj -S --dynamic-table -r -A %t.exe \
# RUN: | FileCheck -check-prefix=REL %s
# CHECK: Disassembly of section .text:
@@ -58,14 +58,14 @@
# REL-NEXT: ]
# REL-NEXT: Address: 0x[[GOTPLTADDR:[0-9A-F]+]]
+# REL: 0x70000032 MIPS_PLTGOT 0x[[GOTPLTADDR]]
+
# REL: Relocations [
# REL-NEXT: Section (7) .rel.plt {
# REL-NEXT: 0x[[PLTSLOT:[0-9A-F]+]] R_MIPS_JUMP_SLOT foo0 0x0
# REL-NEXT: }
# REL-NEXT: ]
-# REL: 0x70000032 MIPS_PLTGOT 0x[[GOTPLTADDR]]
-
# REL: Primary GOT {
# REL: Local entries [
# REL-NEXT: ]
diff --git a/lld/test/ELF/mips-32.s b/lld/test/ELF/mips-32.s
index eb49be237b08..c856e9dbdd7b 100644
--- a/lld/test/ELF/mips-32.s
+++ b/lld/test/ELF/mips-32.s
@@ -14,7 +14,7 @@
# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s -o %t-el.o
# RUN: ld.lld -shared %t-el.o -script %t.script -o %t-el.so
# RUN: llvm-objdump -t -s %t-el.so | FileCheck -check-prefixes=SYM,EL %s
-# RUN: llvm-readelf -r -s --dynamic-table -A %t-el.so \
+# RUN: llvm-readelf --dynamic-table -r -s -A %t-el.so \
# RUN: | FileCheck -check-prefix=REL %s
.data
@@ -34,6 +34,12 @@ v2:
# EL: Contents of section .data:
# EL-NEXT: {{.*}} 04000000 00100100
# ^-- v2+4 ^-- v1
+
+# REL: Dynamic section
+# REL: (RELSZ) 16
+# REL: (RELENT) 8
+# REL-NOT: (RELCOUNT)
+
# REL: Relocation section
# REL: {{.*}} R_MIPS_REL32
# REL-NEXT: {{.*}} R_MIPS_REL32 [[V2:[0-9a-f]+]]
@@ -41,10 +47,5 @@ v2:
# REL: Symbol table
# REL: {{.*}}: [[V2]] {{.*}} v2
-# REL: Dynamic section
-# REL: (RELSZ) 16
-# REL: (RELENT) 8
-# REL-NOT: (RELCOUNT)
-
# REL: Global entries
# REL: {{.*}} -32744(gp) [[V2]] {{.*}} v2
diff --git a/lld/test/ELF/mips-64.s b/lld/test/ELF/mips-64.s
index b5cdf27d052e..4db845857bbc 100644
--- a/lld/test/ELF/mips-64.s
+++ b/lld/test/ELF/mips-64.s
@@ -4,7 +4,7 @@
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o
# RUN: ld.lld -shared %t.o -o %t.so
# RUN: llvm-objdump -s -t %t.so | FileCheck -check-prefix=SYM %s
-# RUN: llvm-readelf -r -s --dynamic-table -A %t.so | FileCheck %s
+# RUN: llvm-readelf --dynamic-table -r -s -A %t.so | FileCheck %s
.data
.globl v2
@@ -19,6 +19,10 @@ v2:
# SYM: Contents of section .data:
# SYM-NEXT: {{.*}} 00000000 00000008 00000000 [[V1]]
+# CHECK: Dynamic section
+# CHECK: (RELSZ) 32 (bytes)
+# CHECK: (RELENT) 16 (bytes)
+
# CHECK: Relocation section
# CHECK: [[V2:[0-9a-f]+]] {{.*}} R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE
# CHECK: [[V1:[0-9a-f]+]] {{.*}} R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE [[V2]] v2
@@ -27,10 +31,6 @@ v2:
# CHECK: {{.*}}: [[V1]] {{.*}} v1
# CHECK: {{.*}}: [[V2]] {{.*}} v2
-# CHECK: Dynamic section
-# CHECK: (RELSZ) 32 (bytes)
-# CHECK: (RELENT) 16 (bytes)
-
# CHECK: Primary GOT:
# CHECK: Global entries:
# CHECK: {{.*}} -32736(gp) [[V2]] [[V2]] {{.*}} v2
diff --git a/lld/test/ELF/mips-dynamic.s b/lld/test/ELF/mips-dynamic.s
index eca61bb757c3..9110b2fdc77f 100644
--- a/lld/test/ELF/mips-dynamic.s
+++ b/lld/test/ELF/mips-dynamic.s
@@ -96,11 +96,6 @@
# DSO-NEXT: Offset:
# DSO-NEXT: Size: 8
# DSO: ]
-# DSO: DynamicSymbols [
-# DSO: Name:
-# DSO: Name: __start
-# DSO: Name: _foo
-# DSO: ]
# DSO: DynamicSection [
# DSO-NEXT: Tag Type Name/Value
# DSO-DAG: 0x00000003 PLTGOT [[GOTADDR]]
@@ -110,6 +105,11 @@
# DSO-DAG: 0x7000000A MIPS_LOCAL_GOTNO 2
# DSO-DAG: 0x70000011 MIPS_SYMTABNO 3
# DSO-DAG: 0x70000013 MIPS_GOTSYM 0x3
+# DSO: ]
+# DSO-NEXT: DynamicSymbols [
+# DSO: Name:
+# DSO: Name: __start
+# DSO: Name: _foo
# DSO: ]
.text
diff --git a/lld/test/ELF/mips-got-weak.s b/lld/test/ELF/mips-got-weak.s
index a5fdfa39fcb9..93d2cedb7a2f 100644
--- a/lld/test/ELF/mips-got-weak.s
+++ b/lld/test/ELF/mips-got-weak.s
@@ -9,13 +9,6 @@
# RUN: llvm-readelf -r --dyn-syms --dynamic-table -A %t2.so \
# RUN: | FileCheck -check-prefixes=CHECK,SYM %s
-# CHECK: There are no relocations in this file.
-
-# CHECK: Symbol table '.dynsym'
-# CHECK-DAG: [[FOO:[0-9a-f]+]] 0 NOTYPE WEAK DEFAULT 8 foo
-# CHECK-DAG: 00000000 0 NOTYPE WEAK DEFAULT UND bar
-# CHECK-DAG: [[SYM:[0-9a-f]+]] 0 NOTYPE GLOBAL DEFAULT 8 sym
-
# CHECK: Dynamic section
# CHECK: (MIPS_SYMTABNO) 4
# NOSYM: (MIPS_LOCAL_GOTNO) 2
@@ -23,6 +16,13 @@
# SYM: (MIPS_LOCAL_GOTNO) 4
# SYM: (MIPS_GOTSYM) 0x3
+# CHECK: There are no relocations in this file.
+
+# CHECK: Symbol table '.dynsym'
+# CHECK-DAG: [[FOO:[0-9a-f]+]] 0 NOTYPE WEAK DEFAULT 8 foo
+# CHECK-DAG: 00000000 0 NOTYPE WEAK DEFAULT UND bar
+# CHECK-DAG: [[SYM:[0-9a-f]+]] 0 NOTYPE GLOBAL DEFAULT 8 sym
+
# NOSYM: Primary GOT:
# NOSYM-NOT: Local entries:
# NOSYM: Global entries:
diff --git a/lld/test/ELF/mips-options.s b/lld/test/ELF/mips-options.s
index f87a3990cb9d..3b4e31c3cb53 100644
--- a/lld/test/ELF/mips-options.s
+++ b/lld/test/ELF/mips-options.s
@@ -15,9 +15,6 @@
__start:
lui $gp, %hi(%neg(%gp_rel(g1)))
-# CHECK: Name: _gp
-# CHECK-NEXT: Value: 0x[[GP:[0-9A-F]+]]
-
# CHECK: ProgramHeader {
# CHECK: Type: PT_MIPS_OPTIONS
# CHECK-NEXT: Offset:
@@ -31,6 +28,9 @@ __start:
# CHECK-NEXT: Alignment: 8
# CHECK-NEXT: }
+# CHECK: Name: _gp
+# CHECK-NEXT: Value: 0x[[GP:[0-9A-F]+]]
+
# CHECK: MIPS Options {
# CHECK-NEXT: ODK_REGINFO {
# CHECK-NEXT: GP: 0x[[GP]]
diff --git a/lld/test/ELF/partition-exidx.s b/lld/test/ELF/partition-exidx.s
index 9dff6c0055b4..807b61c4facf 100644
--- a/lld/test/ELF/partition-exidx.s
+++ b/lld/test/ELF/partition-exidx.s
@@ -9,25 +9,25 @@
// Change upper case to lower case so that we can match unwind info (which is dumped
// in upper case) against program headers (which are dumped in lower case).
-// RUN: llvm-readelf -l --unwind %t0 | tr A-Z a-z | FileCheck %s
-// RUN: llvm-readelf -l --unwind %t1 | tr A-Z a-z | FileCheck %s
+// RUN: llvm-readelf -l --unwind %t0 | tr A-Z a-z | FileCheck --ignore-case %s
+// RUN: llvm-readelf -l --unwind %t1 | tr A-Z a-z | FileCheck --ignore-case %s
+
+// CHECK: LOAD {{[^ ]*}} 0x{{0*}}[[TEXT_ADDR:[0-9a-f]+]] {{.*}} R E
+// CHECK: EXIDX 0x{{0*}}[[EXIDX_OFFSET:[0-9a-f]+]] {{.*}} 0x00010 0x00010 R
// Each file should have one exidx section for its text section and one sentinel.
-// CHECK: sectionoffset: 0x[[EXIDX_OFFSET:.*]]
-// CHECK-NEXT: entries [
-// CHECK-NEXT: entry {
-// CHECK-NEXT: functionaddress: 0x[[TEXT_ADDR:.*]]
-// CHECK-NEXT: model: cantunwind
+// CHECK: SectionOffset: 0x[[EXIDX_OFFSET]]
+// CHECK-NEXT: Entries [
+// CHECK-NEXT: Entry {
+// CHECK-NEXT: Functionaddress: 0x[[TEXT_ADDR]]
+// CHECK-NEXT: Model: CantUnwind
// CHECK-NEXT: }
-// CHECK-NEXT: entry {
-// CHECK-NEXT: functionaddress:
-// CHECK-NEXT: model: cantunwind
+// CHECK-NEXT: Entry {
+// CHECK-NEXT: FunctionAddress:
+// CHECK-NEXT: Model: CantUnwind
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK: load {{[^ ]*}} 0x{{0*}}[[TEXT_ADDR]] {{.*}} r e
-// CHECK: exidx 0x{{0*}}[[EXIDX_OFFSET]] {{.*}} 0x00010 0x00010 r
-
.section .llvm_sympart,"",%llvm_sympart
.asciz "part1"
.4byte p1
diff --git a/lld/test/ELF/partition-pack-dyn-relocs.s b/lld/test/ELF/partition-pack-dyn-relocs.s
index 8b12ac1d02d9..3727bcc21614 100644
--- a/lld/test/ELF/partition-pack-dyn-relocs.s
+++ b/lld/test/ELF/partition-pack-dyn-relocs.s
@@ -18,6 +18,10 @@
// PART0: .data PROGBITS 000000000000[[DATA_SEGMENT:.]]378
// PART1: .data PROGBITS 000000000000[[DATA_SEGMENT:.]]340
+// CHECK: Dynamic section
+// CHECK: 0x0000000060000011 (ANDROID_RELA) 0x[[ANDROID_RELA_ADDR]]
+// CHECK: 0x0000000000000024 (RELR) 0x[[RELR_ADDR]]
+
// CHECK: Relocation section '.rela.dyn'
// CHECK-NEXT: Offset
// PART0-NEXT: 000000000000[[DATA_SEGMENT]]380 {{.*}} R_X86_64_64 000000000000[[DATA_SEGMENT]]378 p0 + 0
@@ -30,10 +34,6 @@
// PART1-NEXT: 000000000000[[DATA_SEGMENT]]340 {{.*}} R_X86_64_RELATIVE
// CHECK-EMPTY:
-// CHECK: Dynamic section
-// CHECK: 0x0000000060000011 (ANDROID_RELA) 0x[[ANDROID_RELA_ADDR]]
-// CHECK: 0x0000000000000024 (RELR) 0x[[RELR_ADDR]]
-
.section .llvm_sympart,"", at llvm_sympart
.asciz "part1"
.quad p1
diff --git a/lld/test/ELF/partition-synthetic-sections.s b/lld/test/ELF/partition-synthetic-sections.s
index deb87780d2e3..9fa5ef97efc4 100644
--- a/lld/test/ELF/partition-synthetic-sections.s
+++ b/lld/test/ELF/partition-synthetic-sections.s
@@ -51,6 +51,55 @@
// CHECK-NEXT: .strtab STRTAB
// CHECK-NEXT: Key to Flags
+// CHECK: Program Headers:
+// CHECK-NEXT: Type
+// PART0-NEXT: PHDR {{.*}} 0x000230 0x000230 R
+// PART1-NEXT: PHDR {{.*}} 0x0001f8 0x0001f8 R
+// PART0-NEXT: LOAD 0x000000 0x0000000000000000 0x0000000000000000 {{.*}} R 0x1000
+// PART0-NEXT: LOAD 0x001000 0x0000000000001000 0x0000000000001000 {{.*}} R E 0x1000
+// PART0-NEXT: LOAD 0x002000 0x0000000000002000 0x0000000000002000 {{.*}} RW 0x1000
+// PART0-NEXT: LOAD 0x002178 0x0000000000003178 0x0000000000003178 {{.*}} RW 0x1000
+// PART0-NEXT: LOAD 0x003150 0x0000000000008150 0x0000000000008150 0x000000 0x001000 RW 0x1000
+// PART1-NEXT: LOAD 0x000000 0x0000000000004000 0x0000000000004000 {{.*}} R 0x1000
+// PART1-NEXT: LOAD 0x001000 0x0000000000005000 0x0000000000005000 {{.*}} R E 0x1000
+// PART1-NEXT: LOAD 0x002000 0x0000000000006000 0x0000000000006000 {{.*}} RW 0x1000
+// PART1-NEXT: LOAD 0x002130 0x0000000000007130 0x0000000000007130 {{.*}} RW 0x1000
+// CHECK-NEXT: DYNAMIC {{.*}} 0x{{0*}}[[DYNAMIC_ADDR]] 0x{{0*}}[[DYNAMIC_ADDR]] {{.*}} RW 0x8
+// PART0-NEXT: GNU_RELRO 0x002000 0x0000000000002000 0x0000000000002000 {{.*}} R 0x1
+// PART1-NEXT: GNU_RELRO 0x002000 0x0000000000006000 0x0000000000006000 {{.*}} R 0x1
+// CHECK-NEXT: GNU_EH_FRAME {{.*}} 0x{{0*}}[[EH_FRAME_HDR_ADDR]] 0x{{0*}}[[EH_FRAME_HDR_ADDR]] {{.*}} R 0x4
+// CHECK-NEXT: GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x0
+// CHECK-EMPTY:
+
+// CHECK: Dynamic section
+// CHECK-NEXT: Tag
+// CHECK-NEXT: 0x0000000000000001 (NEEDED) Shared library: [verneed1.so.0]
+// PART0-NEXT: 0x000000000000000e (SONAME) Library soname: [main.so]
+// PART1-NEXT: 0x0000000000000001 (NEEDED) Shared library: [main.so]
+// PART1-NEXT: 0x000000000000000e (SONAME) Library soname: [part1]
+// CHECK-NEXT: 0x0000000000000007 (RELA) 0x[[RELA_DYN_ADDR]]
+// CHECK-NEXT: 0x0000000000000008 (RELASZ)
+// CHECK-NEXT: 0x0000000000000009 (RELAENT) 24 (bytes)
+// PART1-NEXT: 0x000000006ffffff9 (RELACOUNT) 1
+// PART0-NEXT: 0x0000000000000017 (JMPREL) 0x[[RELA_PLT_ADDR]]
+// PART0-NEXT: 0x0000000000000002 (PLTRELSZ) 48 (bytes)
+// PART0-NEXT: 0x0000000000000003 (PLTGOT) 0x[[GOT_PLT_ADDR]]
+// PART0-NEXT: 0x0000000000000014 (PLTREL) RELA
+// CHECK-NEXT: 0x0000000000000006 (SYMTAB) 0x[[DYNSYM_ADDR]]
+// CHECK-NEXT: 0x000000000000000b (SYMENT) 24 (bytes)
+// CHECK-NEXT: 0x0000000000000005 (STRTAB) 0x[[DYNSTR_ADDR]]
+// CHECK-NEXT: 0x000000000000000a (STRSZ)
+// CHECK-NEXT: 0x000000006ffffef5 (GNU_HASH) 0x[[GNU_HASH_ADDR]]
+// CHECK-NEXT: 0x0000000000000004 (HASH) 0x[[HASH_ADDR]]
+// PART0-NEXT: 0x0000000000000019 (INIT_ARRAY) 0x[[INIT_ARRAY_ADDR]]
+// PART0-NEXT: 0x000000000000001b (INIT_ARRAYSZ) 8 (bytes)
+// CHECK-NEXT: 0x000000006ffffff0 (VERSYM) 0x[[VERSYM_ADDR]]
+// CHECK-NEXT: 0x000000006ffffffc (VERDEF) 0x[[VERDEF_ADDR]]
+// CHECK-NEXT: 0x000000006ffffffd (VERDEFNUM) 3
+// CHECK-NEXT: 0x000000006ffffffe (VERNEED) 0x[[VERNEED_ADDR]]
+// CHECK-NEXT: 0x000000006fffffff (VERNEEDNUM) 1
+// PART0-NEXT: 0x0000000000000000 (NULL) 0x0
+
// CHECK: Relocation section '.rela.dyn'
// CHECK-NEXT: Offset
// PART0-NEXT: 000000000000[[DATA_SEGMENT]]178 {{.*}} R_X86_64_64 {{.*}} f1 at v3 + 0
@@ -59,13 +108,25 @@
// PART1-NEXT: 000000000000[[DATA_SEGMENT]]130 {{.*}} R_X86_64_64 {{.*}} f2 at v2 + 0
// PART1-NEXT: 000000000000[[DATA_SEGMENT]]138 {{.*}} R_X86_64_64 {{.*}} p0@@x1 + 0
// PART1-NEXT: 000000000000[[DATA_SEGMENT]]140 {{.*}} R_X86_64_64 {{.*}} p0@@x1 + 0
-// CHECK-EMPTY:
// PART0: Relocation section '.rela.plt'
// PART0-NEXT: Offset
// PART0-NEXT: 000000000000[[DATA_SEGMENT]]198 {{.*}} R_X86_64_JUMP_SLOT {{.*}} f1 at v3 + 0
// PART0-NEXT: 000000000000[[DATA_SEGMENT]]1a0 {{.*}} R_X86_64_JUMP_SLOT {{.*}} f2 at v2 + 0
-// PART0-EMPTY:
+
+// CHECK-NEXT: EHFrameHeader
+// CHECK: Address: 0x[[EH_FRAME_HDR_ADDR]]
+// CHECK: eh_frame_ptr: 0x[[EH_FRAME_ADDR]]
+// CHECK: initial_location: 0x[[TEXT_ADDR]]
+// CHECK: address: 0x[[FDE_ADDR:.*]]
+
+// CHECK: .eh_frame section
+// CHECK: 0x[[EH_FRAME_ADDR]]] CIE length=20
+// CHECK-NOT: FDE
+// CHECK: 0x[[FDE_ADDR]]] FDE length=20 cie={{.}}0x[[EH_FRAME_ADDR]]
+// CHECK-NEXT: initial_location: 0x[[TEXT_ADDR]]
+// CHECK-NOT: FDE
+// CHECK: CIE length=0
// CHECK: Symbol table '.dynsym'
// PART0: 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f1 at v3
@@ -88,69 +149,6 @@
// 0x490 + 0x3b70 = 0x4000
// PART-INDEX-NEXT: 048c 26ffffff 703b0000 50410000
-// CHECK: {{.*}}EHFrameHeader
-// CHECK: Address: 0x[[EH_FRAME_HDR_ADDR]]
-// CHECK: eh_frame_ptr: 0x[[EH_FRAME_ADDR]]
-// CHECK: initial_location: 0x[[TEXT_ADDR]]
-// CHECK: address: 0x[[FDE_ADDR:.*]]
-
-// CHECK: .eh_frame section
-// CHECK: 0x[[EH_FRAME_ADDR]]] CIE length=20
-// CHECK-NOT: FDE
-// CHECK: 0x[[FDE_ADDR]]] FDE length=20 cie={{.}}0x[[EH_FRAME_ADDR]]
-// CHECK-NEXT: initial_location: 0x[[TEXT_ADDR]]
-// CHECK-NOT: FDE
-// CHECK: CIE length=0
-
-// CHECK: Dynamic section
-// CHECK-NEXT: Tag
-// CHECK-NEXT: 0x0000000000000001 (NEEDED) Shared library: [verneed1.so.0]
-// PART0-NEXT: 0x000000000000000e (SONAME) Library soname: [main.so]
-// PART1-NEXT: 0x0000000000000001 (NEEDED) Shared library: [main.so]
-// PART1-NEXT: 0x000000000000000e (SONAME) Library soname: [part1]
-// CHECK-NEXT: 0x0000000000000007 (RELA) 0x[[RELA_DYN_ADDR]]
-// CHECK-NEXT: 0x0000000000000008 (RELASZ)
-// CHECK-NEXT: 0x0000000000000009 (RELAENT) 24 (bytes)
-// PART1-NEXT: 0x000000006ffffff9 (RELACOUNT) 1
-// PART0-NEXT: 0x0000000000000017 (JMPREL) 0x[[RELA_PLT_ADDR]]
-// PART0-NEXT: 0x0000000000000002 (PLTRELSZ) 48 (bytes)
-// PART0-NEXT: 0x0000000000000003 (PLTGOT) 0x[[GOT_PLT_ADDR]]
-// PART0-NEXT: 0x0000000000000014 (PLTREL) RELA
-// CHECK-NEXT: 0x0000000000000006 (SYMTAB) 0x[[DYNSYM_ADDR]]
-// CHECK-NEXT: 0x000000000000000b (SYMENT) 24 (bytes)
-// CHECK-NEXT: 0x0000000000000005 (STRTAB) 0x[[DYNSTR_ADDR]]
-// CHECK-NEXT: 0x000000000000000a (STRSZ)
-// CHECK-NEXT: 0x000000006ffffef5 (GNU_HASH) 0x[[GNU_HASH_ADDR]]
-// CHECK-NEXT: 0x0000000000000004 (HASH) 0x[[HASH_ADDR]]
-// PART0-NEXT: 0x0000000000000019 (INIT_ARRAY) 0x[[INIT_ARRAY_ADDR]]
-// PART0-NEXT: 0x000000000000001b (INIT_ARRAYSZ) 8 (bytes)
-// CHECK-NEXT: 0x000000006ffffff0 (VERSYM) 0x[[VERSYM_ADDR]]
-// CHECK-NEXT: 0x000000006ffffffc (VERDEF) 0x[[VERDEF_ADDR]]
-// CHECK-NEXT: 0x000000006ffffffd (VERDEFNUM) 3
-// CHECK-NEXT: 0x000000006ffffffe (VERNEED) 0x[[VERNEED_ADDR]]
-// CHECK-NEXT: 0x000000006fffffff (VERNEEDNUM) 1
-// PART0-NEXT: 0x0000000000000000 (NULL) 0x0
-
-// CHECK: Program Headers:
-// CHECK-NEXT: Type
-// PART0-NEXT: PHDR {{.*}} 0x000230 0x000230 R
-// PART1-NEXT: PHDR {{.*}} 0x0001f8 0x0001f8 R
-// PART0-NEXT: LOAD 0x000000 0x0000000000000000 0x0000000000000000 {{.*}} R 0x1000
-// PART0-NEXT: LOAD 0x001000 0x0000000000001000 0x0000000000001000 {{.*}} R E 0x1000
-// PART0-NEXT: LOAD 0x002000 0x0000000000002000 0x0000000000002000 {{.*}} RW 0x1000
-// PART0-NEXT: LOAD 0x002178 0x0000000000003178 0x0000000000003178 {{.*}} RW 0x1000
-// PART0-NEXT: LOAD 0x003150 0x0000000000008150 0x0000000000008150 0x000000 0x001000 RW 0x1000
-// PART1-NEXT: LOAD 0x000000 0x0000000000004000 0x0000000000004000 {{.*}} R 0x1000
-// PART1-NEXT: LOAD 0x001000 0x0000000000005000 0x0000000000005000 {{.*}} R E 0x1000
-// PART1-NEXT: LOAD 0x002000 0x0000000000006000 0x0000000000006000 {{.*}} RW 0x1000
-// PART1-NEXT: LOAD 0x002130 0x0000000000007130 0x0000000000007130 {{.*}} RW 0x1000
-// CHECK-NEXT: DYNAMIC {{.*}} 0x{{0*}}[[DYNAMIC_ADDR]] 0x{{0*}}[[DYNAMIC_ADDR]] {{.*}} RW 0x8
-// PART0-NEXT: GNU_RELRO 0x002000 0x0000000000002000 0x0000000000002000 {{.*}} R 0x1
-// PART1-NEXT: GNU_RELRO 0x002000 0x0000000000006000 0x0000000000006000 {{.*}} R 0x1
-// CHECK-NEXT: GNU_EH_FRAME {{.*}} 0x{{0*}}[[EH_FRAME_HDR_ADDR]] 0x{{0*}}[[EH_FRAME_HDR_ADDR]] {{.*}} R 0x4
-// CHECK-NEXT: GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x0
-// CHECK-EMPTY:
-
// CHECK: Version symbols section '.gnu.version'
// CHECK-NEXT: Addr:
// PART0-NEXT: 000: 0 (*local*) 4 (v3) 5 (v2) 2 (x1)
diff --git a/lld/test/ELF/ppc32-call-stub-nopic.s b/lld/test/ELF/ppc32-call-stub-nopic.s
index d2b9d460a568..2c49a1f32468 100644
--- a/lld/test/ELF/ppc32-call-stub-nopic.s
+++ b/lld/test/ELF/ppc32-call-stub-nopic.s
@@ -10,14 +10,14 @@
# RUN: llvm-readelf -x .plt %t | FileCheck --check-prefix=HEX %s
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
+# SEC: .got PROGBITS 100202b8
+# RELOC: PPC_GOT 0x100202B8
+
# RELOC: .rela.plt {
# RELOC-NEXT: 0x100302C4 R_PPC_JMP_SLOT f 0x0
# RELOC-NEXT: 0x100302C8 R_PPC_JMP_SLOT g 0x0
# RELOC-NEXT: }
-# SEC: .got PROGBITS 100202b8
-# RELOC: PPC_GOT 0x100202B8
-
## .got2+0x8000-0x10004 = 0x30000+0x8000-0x10004 = 65536*2+32764
# CHECK-LABEL: _start:
# CHECK-NEXT: bl .+16
diff --git a/lld/test/ELF/pre_init_fini_array.s b/lld/test/ELF/pre_init_fini_array.s
index fd60c45125f3..dacd74d8ae0e 100644
--- a/lld/test/ELF/pre_init_fini_array.s
+++ b/lld/test/ELF/pre_init_fini_array.s
@@ -59,6 +59,14 @@ _start:
// CHECK-NEXT: Offset:
// CHECK-NEXT: Size: [[FINI_SIZE:.*]]
+// CHECK: DynamicSection
+// CHECK: PREINIT_ARRAY [[PREINIT_ADDR]]
+// CHECK: PREINIT_ARRAYSZ [[PREINIT_SIZE]] (bytes)
+// CHECK: INIT_ARRAY [[INIT_ADDR]]
+// CHECK: INIT_ARRAYSZ [[INIT_SIZE]] (bytes)
+// CHECK: FINI_ARRAY [[FINI_ADDR]]
+// CHECK: FINI_ARRAYSZ [[FINI_SIZE]] (bytes)
+
// CHECK: Relocations [
// CHECK-NEXT: ]
@@ -128,14 +136,6 @@ _start:
// CHECK-NEXT: Section: .preinit_array
// CHECK-NEXT: }
-// CHECK: DynamicSection
-// CHECK: PREINIT_ARRAY [[PREINIT_ADDR]]
-// CHECK: PREINIT_ARRAYSZ [[PREINIT_SIZE]] (bytes)
-// CHECK: INIT_ARRAY [[INIT_ADDR]]
-// CHECK: INIT_ARRAYSZ [[INIT_SIZE]] (bytes)
-// CHECK: FINI_ARRAY [[FINI_ADDR]]
-// CHECK: FINI_ARRAYSZ [[FINI_SIZE]] (bytes)
-
// DISASM: _start:
// DISASM-NEXT: callq {{.*}} <__preinit_array_start>
// DISASM-NEXT: callq {{.*}} <__fini_array_start>
diff --git a/lld/test/ELF/relocation-copy-relro.s b/lld/test/ELF/relocation-copy-relro.s
index 5b2460e39970..91994501a301 100644
--- a/lld/test/ELF/relocation-copy-relro.s
+++ b/lld/test/ELF/relocation-copy-relro.s
@@ -18,9 +18,6 @@
// CHECK-NEXT: Offset: 0x368
// CHECK-NEXT: Size: 8
-// CHECK: 0x202368 R_X86_64_COPY a 0x0
-// CHECK: 0x20236C R_X86_64_COPY b 0x0
-
// CHECK: Type: PT_GNU_RELRO (0x6474E552)
// CHECK-NEXT: Offset: 0x2A8
// CHECK-NEXT: VirtualAddress: 0x2022A8
@@ -28,6 +25,9 @@
// CHECK-NEXT: FileSize: 192
// CHECK-NEXT: MemSize: 3416
+// CHECK: 0x202368 R_X86_64_COPY a 0x0
+// CHECK: 0x20236C R_X86_64_COPY b 0x0
+
.text
.global _start
_start:
diff --git a/lld/test/ELF/riscv-tls-ie.s b/lld/test/ELF/riscv-tls-ie.s
index f88c3ed28a8f..424edb9f690a 100644
--- a/lld/test/ELF/riscv-tls-ie.s
+++ b/lld/test/ELF/riscv-tls-ie.s
@@ -22,17 +22,17 @@
# RUN: llvm-readelf -x .got %t.64 | FileCheck --check-prefix=LE64-GOT %s
# RUN: llvm-objdump -d --no-show-raw-insn %t.64 | FileCheck --check-prefixes=LE,LE64 %s
+# IE32-REL: FLAGS STATIC_TLS
# IE32-REL: .rela.dyn {
# IE32-REL-NEXT: 0x2218 R_RISCV_TLS_TPREL32 - 0xC
# IE32-REL-NEXT: 0x2214 R_RISCV_TLS_TPREL32 a 0x0
# IE32-REL-NEXT: }
-# IE32-REL: FLAGS STATIC_TLS
+# IE64-REL: FLAGS STATIC_TLS
# IE64-REL: .rela.dyn {
# IE64-REL-NEXT: 0x2370 R_RISCV_TLS_TPREL64 - 0xC
# IE64-REL-NEXT: 0x2368 R_RISCV_TLS_TPREL64 a 0x0
# IE64-REL-NEXT: }
-# IE64-REL: FLAGS STATIC_TLS
## rv32: &.got[0] - . = 0x2214 - . = 4096*1+112
## rv64: &.got[0] - . = 0x2368 - . = 4096*1+200
diff --git a/lld/test/ELF/shared.s b/lld/test/ELF/shared.s
index 583ed92127b5..800570e63b95 100644
--- a/lld/test/ELF/shared.s
+++ b/lld/test/ELF/shared.s
@@ -4,7 +4,7 @@
// RUN: ld.lld --hash-style=sysv -shared %t2.o -soname=t2.so -o %t2.so
// RUN: llvm-readobj -S %t2.so | FileCheck --check-prefix=SO %s
// RUN: ld.lld --hash-style=sysv -dynamic-linker /lib64/ld-linux-x86-64.so.2 -rpath foo -rpath bar --export-dynamic %t.o %t2.so -o %t
-// RUN: llvm-readobj --program-headers --dynamic-table --symbols -S --dyn-syms --section-data --hash-table %t | FileCheck %s
+// RUN: llvm-readobj -S -l --dynamic-table --symbols --dyn-syms --section-data --hash-table %t | FileCheck %s
// RUN: ld.lld --hash-style=sysv %t.o %t2.so %t2.so -o %t2
// RUN: llvm-readobj --dyn-syms %t2 | FileCheck --check-prefix=DONT_EXPORT %s
@@ -129,6 +129,47 @@
// CHECK-NEXT: AddressAlignment:
// CHECK-NEXT: EntrySize: [[SYMENT:.*]]
+// CHECK: ProgramHeaders [
+// CHECK: Type: PT_INTERP
+// CHECK-NEXT: Offset: [[INTERPOFFSET]]
+// CHECK-NEXT: VirtualAddress: [[INTERPADDR]]
+// CHECK-NEXT: PhysicalAddress: [[INTERPADDR]]
+// CHECK-NEXT: FileSize: [[INTERPSIZE]]
+// CHECK-NEXT: MemSize: [[INTERPSIZE]]
+// CHECK-NEXT: Flags [
+// CHECK-NEXT: PF_R
+// CHECK-NEXT: ]
+// CHECK-NEXT: Alignment: 1
+// CHECK-NEXT: }
+// CHECK: Type: PT_DYNAMIC
+// CHECK-NEXT: Offset: [[OFFSET]]
+// CHECK-NEXT: VirtualAddress: [[ADDR]]
+// CHECK-NEXT: PhysicalAddress: [[ADDR]]
+// CHECK-NEXT: FileSize: [[SIZE]]
+// CHECK-NEXT: MemSize: [[SIZE]]
+// CHECK-NEXT: Flags [
+// CHECK-NEXT: PF_R
+// CHECK-NEXT: PF_W
+// CHECK-NEXT: ]
+// CHECK-NEXT: Alignment: [[ALIGN]]
+// CHECK-NEXT: }
+
+// CHECK: DynamicSection [
+// CHECK-NEXT: Tag Type Name/Value
+// CHECK-NEXT: 0x0000001D RUNPATH Library runpath: [foo:bar]
+// CHECK-NEXT: 0x00000001 NEEDED Shared library: [{{.*}}2.so]
+// CHECK-NEXT: 0x00000015 DEBUG 0x0
+// CHECK-NEXT: 0x00000011 REL [[RELADDR]]
+// CHECK-NEXT: 0x00000012 RELSZ [[RELSIZE]] (bytes)
+// CHECK-NEXT: 0x00000013 RELENT [[RELENT]] (bytes)
+// CHECK-NEXT: 0x00000006 SYMTAB [[DYNSYMADDR]]
+// CHECK-NEXT: 0x0000000B SYMENT [[SYMENT]] (bytes)
+// CHECK-NEXT: 0x00000005 STRTAB [[DYNSTRADDR]]
+// CHECK-NEXT: 0x0000000A STRSZ
+// CHECK-NEXT: 0x00000004 HASH [[HASHADDR]]
+// CHECK-NEXT: 0x00000000 NULL 0x0
+// CHECK-NEXT: ]
+
// CHECK: Symbols [
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name:
@@ -248,47 +289,6 @@
// DONT_EXPORT-NEXT: }
// DONT_EXPORT-NEXT: ]
-// CHECK: DynamicSection [
-// CHECK-NEXT: Tag Type Name/Value
-// CHECK-NEXT: 0x0000001D RUNPATH Library runpath: [foo:bar]
-// CHECK-NEXT: 0x00000001 NEEDED Shared library: [{{.*}}2.so]
-// CHECK-NEXT: 0x00000015 DEBUG 0x0
-// CHECK-NEXT: 0x00000011 REL [[RELADDR]]
-// CHECK-NEXT: 0x00000012 RELSZ [[RELSIZE]] (bytes)
-// CHECK-NEXT: 0x00000013 RELENT [[RELENT]] (bytes)
-// CHECK-NEXT: 0x00000006 SYMTAB [[DYNSYMADDR]]
-// CHECK-NEXT: 0x0000000B SYMENT [[SYMENT]] (bytes)
-// CHECK-NEXT: 0x00000005 STRTAB [[DYNSTRADDR]]
-// CHECK-NEXT: 0x0000000A STRSZ
-// CHECK-NEXT: 0x00000004 HASH [[HASHADDR]]
-// CHECK-NEXT: 0x00000000 NULL 0x0
-// CHECK-NEXT: ]
-
-// CHECK: ProgramHeaders [
-// CHECK: Type: PT_INTERP
-// CHECK-NEXT: Offset: [[INTERPOFFSET]]
-// CHECK-NEXT: VirtualAddress: [[INTERPADDR]]
-// CHECK-NEXT: PhysicalAddress: [[INTERPADDR]]
-// CHECK-NEXT: FileSize: [[INTERPSIZE]]
-// CHECK-NEXT: MemSize: [[INTERPSIZE]]
-// CHECK-NEXT: Flags [
-// CHECK-NEXT: PF_R
-// CHECK-NEXT: ]
-// CHECK-NEXT: Alignment: 1
-// CHECK-NEXT: }
-// CHECK: Type: PT_DYNAMIC
-// CHECK-NEXT: Offset: [[OFFSET]]
-// CHECK-NEXT: VirtualAddress: [[ADDR]]
-// CHECK-NEXT: PhysicalAddress: [[ADDR]]
-// CHECK-NEXT: FileSize: [[SIZE]]
-// CHECK-NEXT: MemSize: [[SIZE]]
-// CHECK-NEXT: Flags [
-// CHECK-NEXT: PF_R
-// CHECK-NEXT: PF_W
-// CHECK-NEXT: ]
-// CHECK-NEXT: Alignment: [[ALIGN]]
-// CHECK-NEXT: }
-
// CHECK: HashTable {
// CHECK-NEXT: Num Buckets: 4
// CHECK-NEXT: Num Chains: 4
diff --git a/lld/test/ELF/tls.s b/lld/test/ELF/tls.s
index 80f83d66185d..e8db3723a7a5 100644
--- a/lld/test/ELF/tls.s
+++ b/lld/test/ELF/tls.s
@@ -1,7 +1,7 @@
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
// RUN: ld.lld %t -o %tout
-// RUN: llvm-readobj --symbols --sections -l %tout | FileCheck %s
+// RUN: llvm-readobj -S -l --symbols %tout | FileCheck %s
// RUN: llvm-objdump -d %tout | FileCheck %s --check-prefix=DIS
.global _start
@@ -101,6 +101,30 @@ d:
// CHECK-NEXT: EntrySize:
// CHECK-NEXT: }
+// Check that the TLS NOBITS sections weren't added to the R/W PT_LOAD's size.
+
+// CHECK: ProgramHeaders [
+// CHECK: Type: PT_LOAD
+// CHECK: Type: PT_LOAD
+// CHECK: Type: PT_LOAD
+// CHECK: FileSize: 8
+// CHECK-NEXT: MemSize: 8
+// CHECK-NEXT: Flags [
+// CHECK-NEXT: PF_R
+// CHECK-NEXT: PF_W
+// CHECK-NEXT: ]
+// CHECK: Type: PT_TLS
+// CHECK-NEXT: Offset:
+// CHECK-NEXT: VirtualAddress: [[TDATA_ADDR]]
+// CHECK-NEXT: PhysicalAddress: [[TDATA_ADDR]]
+// CHECK-NEXT: FileSize: 8
+// CHECK-NEXT: MemSize: 16
+// CHECK-NEXT: Flags [
+// CHECK-NEXT: PF_R
+// CHECK-NEXT: ]
+// CHECK-NEXT: Alignment:
+// CHECK-NEXT: }
+
// CHECK: Symbols [
// CHECK: Name: a
// CHECK-NEXT: Value: 0x8
@@ -138,30 +162,6 @@ d:
// CHECK-NEXT: Section: .thread_data
// CHECK-NEXT: }
-// Check that the TLS NOBITS sections weren't added to the R/W PT_LOAD's size.
-
-// CHECK: ProgramHeaders [
-// CHECK: Type: PT_LOAD
-// CHECK: Type: PT_LOAD
-// CHECK: Type: PT_LOAD
-// CHECK: FileSize: 8
-// CHECK-NEXT: MemSize: 8
-// CHECK-NEXT: Flags [
-// CHECK-NEXT: PF_R
-// CHECK-NEXT: PF_W
-// CHECK-NEXT: ]
-// CHECK: Type: PT_TLS
-// CHECK-NEXT: Offset:
-// CHECK-NEXT: VirtualAddress: [[TDATA_ADDR]]
-// CHECK-NEXT: PhysicalAddress: [[TDATA_ADDR]]
-// CHECK-NEXT: FileSize: 8
-// CHECK-NEXT: MemSize: 16
-// CHECK-NEXT: Flags [
-// CHECK-NEXT: PF_R
-// CHECK-NEXT: ]
-// CHECK-NEXT: Alignment:
-// CHECK-NEXT: }
-
// DIS: Disassembly of section .text:
// DIS-EMPTY:
// DIS-NEXT: _start:
diff --git a/lld/test/ELF/verneed.s b/lld/test/ELF/verneed.s
index 2da2683e1b2b..e5edaeeb6d07 100644
--- a/lld/test/ELF/verneed.s
+++ b/lld/test/ELF/verneed.s
@@ -7,7 +7,7 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: ld.lld --hash-style=sysv %t.o %t1.so %t2.so -o %t
-# RUN: llvm-readobj -V --sections --section-data --dyn-syms --dynamic-table %t | FileCheck %s
+# RUN: llvm-readobj -S -d --section-data --dyn-syms -V %t | FileCheck %s
# CHECK: Section {
# CHECK: Index: 1
@@ -74,6 +74,10 @@
# CHECK-NEXT: )
# CHECK-NEXT: }
+# CHECK: 0x000000006FFFFFF0 VERSYM [[VERSYM]]
+# CHECK-NEXT: 0x000000006FFFFFFE VERNEED [[VERNEED]]
+# CHECK-NEXT: 0x000000006FFFFFFF VERNEEDNUM 2
+
# CHECK: DynamicSymbols [
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name:
@@ -113,10 +117,6 @@
# CHECK-NEXT: }
# CHECK-NEXT: ]
-# CHECK: 0x000000006FFFFFF0 VERSYM [[VERSYM]]
-# CHECK-NEXT: 0x000000006FFFFFFE VERNEED [[VERNEED]]
-# CHECK-NEXT: 0x000000006FFFFFFF VERNEEDNUM 2
-
# CHECK: VersionSymbols [
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Version: 0
diff --git a/lld/test/ELF/x86-64-gotpc-relax-nopic.s b/lld/test/ELF/x86-64-gotpc-relax-nopic.s
index 2e76e505870b..66ca9c8f1265 100644
--- a/lld/test/ELF/x86-64-gotpc-relax-nopic.s
+++ b/lld/test/ELF/x86-64-gotpc-relax-nopic.s
@@ -45,12 +45,12 @@
# SEC-PIC-NEXT: AddressAlignment:
# SEC-PIC-NEXT: EntrySize:
# SEC-PIC-NEXT: }
+# SEC-PIC: 0x000000006FFFFFF9 RELACOUNT 1
# SEC-PIC: Relocations [
# SEC-PIC-NEXT: Section ({{.*}}) .rela.dyn {
# SEC-PIC-NEXT: 0x2348 R_X86_64_RELATIVE - 0x3350
# SEC-PIC-NEXT: }
# SEC-PIC-NEXT: ]
-# SEC-PIC: 0x000000006FFFFFF9 RELACOUNT 1
## Check that there was no relaxation performed. All values refer to got entry.
## Ex: 0x1000 + 4249 + 7 = 0x20A0
diff --git a/lld/test/ELF/ztext.s b/lld/test/ELF/ztext.s
index 8744f76de0ea..e06d06baaddc 100644
--- a/lld/test/ELF/ztext.s
+++ b/lld/test/ELF/ztext.s
@@ -16,6 +16,10 @@
# If the preference is to have text relocations, don't create plt of copy relocations.
+# CHECK: DynamicSection [
+# CHECK: FLAGS TEXTREL
+# CHECK: TEXTREL 0x0
+
# CHECK: Relocations [
# CHECK-NEXT: Section {{.*}} .rela.dyn {
# CHECK-NEXT: 0x12A0 R_X86_64_RELATIVE - 0x12A0
@@ -24,9 +28,9 @@
# CHECK-NEXT: }
# CHECK-NEXT: ]
-# CHECK: DynamicSection [
-# CHECK: FLAGS TEXTREL
-# CHECK: TEXTREL 0x0
+# STATIC: DynamicSection [
+# STATIC: FLAGS TEXTREL
+# STATIC: TEXTREL 0x0
# STATIC: Relocations [
# STATIC-NEXT: Section {{.*}} .rela.dyn {
@@ -35,10 +39,6 @@
# STATIC-NEXT: }
# STATIC-NEXT: ]
-# STATIC: DynamicSection [
-# STATIC: FLAGS TEXTREL
-# STATIC: TEXTREL 0x0
-
foo:
.quad foo
.quad bar
diff --git a/llvm/test/tools/llvm-objcopy/ELF/partitions.test b/llvm/test/tools/llvm-objcopy/ELF/partitions.test
index 47a9c803b915..af48053156e7 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/partitions.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/partitions.test
@@ -48,17 +48,6 @@ MAIN-NEXT: [10] .symtab SYMTAB 0000000000000000 003008 0000
MAIN-NEXT: [11] .shstrtab STRTAB 0000000000000000 003050 000060 00 0 0 1
MAIN-NEXT: [12] .strtab STRTAB 0000000000000000 0030b0 000011 00 0 0 1
-MAIN: Symbol table '.dynsym' contains 2 entries:
-MAIN-NEXT: Num: Value Size Type Bind Vis Ndx Name
-MAIN-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
-MAIN-NEXT: 1: 0000000000201000 0 NOTYPE GLOBAL DEFAULT 6 _start
-
-MAIN: Symbol table '.symtab' contains 3 entries:
-MAIN-NEXT: Num: Value Size Type Bind Vis Ndx Name
-MAIN-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
-MAIN-NEXT: 1: 0000000000202000 0 NOTYPE LOCAL HIDDEN 7 _DYNAMIC
-MAIN-NEXT: 2: 0000000000201000 0 NOTYPE GLOBAL DEFAULT 6 _start
-
MAIN: Program Headers:
MAIN-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
MAIN-NEXT: PHDR 0x000040 0x0000000000200040 0x0000000000200040 0x0001c0 0x0001c0 R 0x8
@@ -70,6 +59,17 @@ MAIN-NEXT: DYNAMIC 0x002000 0x0000000000202000 0x0000000000202000 0x000
MAIN-NEXT: GNU_RELRO 0x002000 0x0000000000202000 0x0000000000202000 0x000080 0x001000 R 0x1
MAIN-NEXT: GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x0
+MAIN: Symbol table '.dynsym' contains 2 entries:
+MAIN-NEXT: Num: Value Size Type Bind Vis Ndx Name
+MAIN-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+MAIN-NEXT: 1: 0000000000201000 0 NOTYPE GLOBAL DEFAULT 6 _start
+
+MAIN: Symbol table '.symtab' contains 3 entries:
+MAIN-NEXT: Num: Value Size Type Bind Vis Ndx Name
+MAIN-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+MAIN-NEXT: 1: 0000000000202000 0 NOTYPE LOCAL HIDDEN 7 _DYNAMIC
+MAIN-NEXT: 2: 0000000000201000 0 NOTYPE GLOBAL DEFAULT 6 _start
+
PART1: ELF Header:
PART1-NEXT: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
PART1-NEXT: Class: ELF64
@@ -105,16 +105,6 @@ PART1-NEXT: [ 8] .symtab SYMTAB 0000000000000000 002008 000
PART1-NEXT: [ 9] .shstrtab STRTAB 0000000000000000 002038 00004d 00 0 0 1
PART1-NEXT: [10] .strtab STRTAB 0000000000000000 002085 000004 00 0 0 1
-PART1: Symbol table '.dynsym' contains 2 entries:
-PART1-NEXT: Num: Value Size Type Bind Vis Ndx Name
-PART1-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
-PART1-NEXT: 1: 0000000000205000 0 NOTYPE GLOBAL DEFAULT 15 g1
-
-PART1: Symbol table '.symtab' contains 2 entries:
-PART1-NEXT: Num: Value Size Type Bind Vis Ndx Name
-PART1-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
-PART1-NEXT: 1: 0000000000205000 0 NOTYPE GLOBAL DEFAULT 6 g1
-
PART1: Program Headers:
PART1-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PART1-NEXT: PHDR 0x000040 0x0000000000203040 0x0000000000203040 0x000188 0x000188 R 0x1
@@ -125,6 +115,16 @@ PART1-NEXT: DYNAMIC 0x001000 0x0000000000204000 0x0000000000204000 0x00
PART1-NEXT: GNU_RELRO 0x001000 0x0000000000204000 0x0000000000204000 0x000090 0x001000 R 0x1
PART1-NEXT: GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x0
+PART1: Symbol table '.dynsym' contains 2 entries:
+PART1-NEXT: Num: Value Size Type Bind Vis Ndx Name
+PART1-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+PART1-NEXT: 1: 0000000000205000 0 NOTYPE GLOBAL DEFAULT 15 g1
+
+PART1: Symbol table '.symtab' contains 2 entries:
+PART1-NEXT: Num: Value Size Type Bind Vis Ndx Name
+PART1-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+PART1-NEXT: 1: 0000000000205000 0 NOTYPE GLOBAL DEFAULT 6 g1
+
PART2: ELF Header:
PART2-NEXT: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
PART2-NEXT: Class: ELF64
@@ -160,16 +160,6 @@ PART2-NEXT: [ 8] .symtab SYMTAB 0000000000000000 002008 000
PART2-NEXT: [ 9] .shstrtab STRTAB 0000000000000000 002038 00004d 00 0 0 1
PART2-NEXT: [10] .strtab STRTAB 0000000000000000 002085 000004 00 0 0 1
-PART2: Symbol table '.dynsym' contains 2 entries:
-PART2-NEXT: Num: Value Size Type Bind Vis Ndx Name
-PART2-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
-PART2-NEXT: 1: 0000000000208000 0 NOTYPE GLOBAL DEFAULT 23 g2
-
-PART2: Symbol table '.symtab' contains 2 entries:
-PART2-NEXT: Num: Value Size Type Bind Vis Ndx Name
-PART2-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
-PART2-NEXT: 1: 0000000000208000 0 NOTYPE GLOBAL DEFAULT 6 g2
-
PART2: Program Headers:
PART2-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PART2-NEXT: PHDR 0x000040 0x0000000000206040 0x0000000000206040 0x000188 0x000188 R 0x1
@@ -180,6 +170,16 @@ PART2-NEXT: DYNAMIC 0x001000 0x0000000000207000 0x0000000000207000 0x00
PART2-NEXT: GNU_RELRO 0x001000 0x0000000000207000 0x0000000000207000 0x000090 0x001000 R 0x1
PART2-NEXT: GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x0
+PART2: Symbol table '.dynsym' contains 2 entries:
+PART2-NEXT: Num: Value Size Type Bind Vis Ndx Name
+PART2-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+PART2-NEXT: 1: 0000000000208000 0 NOTYPE GLOBAL DEFAULT 23 g2
+
+PART2: Symbol table '.symtab' contains 2 entries:
+PART2-NEXT: Num: Value Size Type Bind Vis Ndx Name
+PART2-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+PART2-NEXT: 1: 0000000000208000 0 NOTYPE GLOBAL DEFAULT 6 g2
+
RUN: not llvm-objcopy --extract-partition=part3 %p/Inputs/partitions.elf %t4 2>&1 | FileCheck --check-prefix=ERROR1 %s
ERROR1: error: could not find partition named 'part3'
diff --git a/llvm/test/tools/llvm-readobj/ELF/all.test b/llvm/test/tools/llvm-readobj/ELF/all.test
index 1f617034d0e4..5d29cce548ac 100644
--- a/llvm/test/tools/llvm-readobj/ELF/all.test
+++ b/llvm/test/tools/llvm-readobj/ELF/all.test
@@ -8,11 +8,11 @@
# LLVM-ALL: LoadName:
# LLVM-ALL: ElfHeader {
# LLVM-ALL: Sections [
+# LLVM-ALL: ProgramHeaders [
# LLVM-ALL: Relocations [
-# LLVM-ALL: Symbols [
# LLVM-ALL: EHFrameHeader {
# LLVM-ALL: .eh_frame section at offset 0x1128 address 0x0:
-# LLVM-ALL: ProgramHeaders [
+# LLVM-ALL: Symbols [
# LLVM-ALL: VersionSymbols [
# LLVM-ALL: VersionDefinitions [
# LLVM-ALL: VersionRequirements [
@@ -25,12 +25,12 @@
# GNU-ALL: ELF Header:
# GNU-ALL: There are {{.*}} section headers, starting at offset {{.*}}:
+# GNU-ALL: Program Headers:
+# GNU-ALL: Dynamic section at offset {{.*}} contains {{.*}} entries:
# GNU-ALL: Relocation section '.rela.data' at offset {{.*}} contains {{.*}} entries:
-# GNU-ALL: Symbol table '.symtab' contains {{.*}} entries:
# GNU-ALL: EHFrameHeader {
# GNU-ALL: .eh_frame section at offset {{.*}} address 0x0:
-# GNU-ALL: Dynamic section at offset {{.*}} contains {{.*}} entries:
-# GNU-ALL: Program Headers:
+# GNU-ALL: Symbol table '.symtab' contains {{.*}} entries:
# GNU-ALL: Version symbols section '.gnu.version' contains {{.*}} entries:
# GNU-ALL: Version definition section '.gnu.version_d' contains {{.*}} entries:
# GNU-ALL: Version needs section '.gnu.version_r' contains {{.*}} entries:
diff --git a/llvm/test/tools/llvm-readobj/ELF/check-output-order.test b/llvm/test/tools/llvm-readobj/ELF/check-output-order.test
index bda782e9f51c..fe656f3b438b 100644
--- a/llvm/test/tools/llvm-readobj/ELF/check-output-order.test
+++ b/llvm/test/tools/llvm-readobj/ELF/check-output-order.test
@@ -11,19 +11,19 @@
# CHECK: There are 5 section headers, starting at offset
# CHECK: Section Headers:
# CHECK: Key to Flags:
-# CHECK: There are no relocations in this file.
-# CHECK: Symbol table '.symtab' contains 1 entries
-# CHECK: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
-# CHECK: Dynamic section at offset
-# CHECK: 0x0000000000000000 (NULL) 0x0
-# CHECK: NeededLibraries [
-# CHECK: ]
# CHECK: Elf file type is DYN (Shared object file)
# CHECK: Entry point 0x0
# CHECK: There are 1 program headers, starting at offset 64
# CHECK: DYNAMIC
# CHECK: Section to Segment mapping:
# CHECK: None .symtab .strtab .shstrtab
+# CHECK: Dynamic section at offset
+# CHECK: 0x0000000000000000 (NULL) 0x0
+# CHECK: NeededLibraries [
+# CHECK: ]
+# CHECK: There are no relocations in this file.
+# CHECK: Symbol table '.symtab' contains 1 entries
+# CHECK: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
# CHECK: There are no section groups in this file.
diff --git a/llvm/test/tools/llvm-readobj/ELF/dynamic-malformed.test b/llvm/test/tools/llvm-readobj/ELF/dynamic-malformed.test
index 98522407b35b..7e1a43c36ad9 100644
--- a/llvm/test/tools/llvm-readobj/ELF/dynamic-malformed.test
+++ b/llvm/test/tools/llvm-readobj/ELF/dynamic-malformed.test
@@ -12,9 +12,9 @@
# WARN: warning: '[[FILE]]': no valid dynamic table was found
# WARN-EMPTY:
# WARN: File:
+# WARN: ProgramHeaders [
# WARN: Symbols [
# WARN: ]
-# WARN: ProgramHeaders [
# WARN-GNU: warning: '[[FILE]]': invalid PT_DYNAMIC size (0x4){{$}}
# WARN-GNU: warning: '[[FILE]]': section with index 1 has invalid size (0x4){{$}}
diff --git a/llvm/tools/llvm-readobj/llvm-readobj.cpp b/llvm/tools/llvm-readobj/llvm-readobj.cpp
index 869292a19079..e87031ff8b95 100644
--- a/llvm/tools/llvm-readobj/llvm-readobj.cpp
+++ b/llvm/tools/llvm-readobj/llvm-readobj.cpp
@@ -466,22 +466,22 @@ static void dumpObject(const ObjectFile *Obj, ScopedPrinter &Writer,
Dumper->printFileHeaders();
if (opts::SectionHeaders)
Dumper->printSectionHeaders();
- if (opts::Relocations)
- Dumper->printRelocations();
- if (opts::DynRelocs)
- Dumper->printDynamicRelocations();
- if (opts::Symbols || opts::DynamicSymbols)
- Dumper->printSymbols(opts::Symbols, opts::DynamicSymbols);
if (opts::HashSymbols)
Dumper->printHashSymbols();
- if (opts::UnwindInfo)
- Dumper->printUnwindInfo();
+ if (opts::ProgramHeaders || opts::SectionMapping == cl::BOU_TRUE)
+ Dumper->printProgramHeaders(opts::ProgramHeaders, opts::SectionMapping);
if (opts::DynamicTable)
Dumper->printDynamicTable();
if (opts::NeededLibraries)
Dumper->printNeededLibraries();
- if (opts::ProgramHeaders || opts::SectionMapping == cl::BOU_TRUE)
- Dumper->printProgramHeaders(opts::ProgramHeaders, opts::SectionMapping);
+ if (opts::Relocations)
+ Dumper->printRelocations();
+ if (opts::DynRelocs)
+ Dumper->printDynamicRelocations();
+ if (opts::UnwindInfo)
+ Dumper->printUnwindInfo();
+ if (opts::Symbols || opts::DynamicSymbols)
+ Dumper->printSymbols(opts::Symbols, opts::DynamicSymbols);
if (!opts::StringDump.empty())
Dumper->printSectionsAsString(Obj, opts::StringDump);
if (!opts::HexDump.empty())
More information about the llvm-commits
mailing list