[llvm] fff9f04 - [llvm-readobj][test] - Cleanup and split tests in tools/llvm-readobj folder.
Georgii Rymar via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 12 01:33:08 PST 2019
Author: Georgii Rymar
Date: 2019-12-12T12:21:58+03:00
New Revision: fff9f049b2e91ce6e670d767866ee4670a4fed31
URL: https://github.com/llvm/llvm-project/commit/fff9f049b2e91ce6e670d767866ee4670a4fed31
DIFF: https://github.com/llvm/llvm-project/commit/fff9f049b2e91ce6e670d767866ee4670a4fed31.diff
LOG: [llvm-readobj][test] - Cleanup and split tests in tools/llvm-readobj folder.
tools/llvm-readobj currently contains tests that are either general for
all file types or that mix file types inside. This patch refactors
these test and leaves only general tests in that folder. All other
tests were moved to ELF/COFF/MachO and wasm accordingly.
I tried to minimize amount of changes, so most of the test parts
remained unchanged. Any further refactorings and improvements for
particular tests should be done independently from this patch.
Differential revision: https://reviews.llvm.org/D71269
Added:
llvm/test/tools/llvm-readobj/COFF/hex-dump.test
llvm/test/tools/llvm-readobj/COFF/relocations.test
llvm/test/tools/llvm-readobj/COFF/sections-ext.test
llvm/test/tools/llvm-readobj/COFF/sections.test
llvm/test/tools/llvm-readobj/COFF/symbols.test
llvm/test/tools/llvm-readobj/ELF/basic.test
llvm/test/tools/llvm-readobj/ELF/hex-dump.test
llvm/test/tools/llvm-readobj/ELF/relocations.test
llvm/test/tools/llvm-readobj/ELF/sections-ext.test
llvm/test/tools/llvm-readobj/ELF/sections.test
llvm/test/tools/llvm-readobj/ELF/symbols.test
llvm/test/tools/llvm-readobj/MachO/hex-dump.test
llvm/test/tools/llvm-readobj/MachO/relocations.test
llvm/test/tools/llvm-readobj/MachO/sections-ext.test
llvm/test/tools/llvm-readobj/wasm/hex-dump.test
llvm/test/tools/llvm-readobj/wasm/relocations.test
llvm/test/tools/llvm-readobj/wasm/sections.test
llvm/test/tools/llvm-readobj/wasm/symbols.test
Modified:
llvm/test/tools/llvm-readobj/MachO/sections.test
llvm/test/tools/llvm-readobj/archive.test
llvm/test/tools/llvm-readobj/basic.test
llvm/test/tools/llvm-readobj/thin-archive.test
Removed:
llvm/test/tools/llvm-readobj/elf-relocations.test
llvm/test/tools/llvm-readobj/error-format.test
llvm/test/tools/llvm-readobj/hex-dump.test
llvm/test/tools/llvm-readobj/relocations.test
llvm/test/tools/llvm-readobj/sections-ext.test
llvm/test/tools/llvm-readobj/sections.test
llvm/test/tools/llvm-readobj/symbols.test
################################################################################
diff --git a/llvm/test/tools/llvm-readobj/COFF/hex-dump.test b/llvm/test/tools/llvm-readobj/COFF/hex-dump.test
new file mode 100644
index 000000000000..d9dd993e29c6
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/COFF/hex-dump.test
@@ -0,0 +1,8 @@
+## Test that --hex-dump/-x can be used to display the contents
+## of the indicated section as hexadecimal bytes.
+
+# RUN: llvm-readobj --hex-dump 1 %p/Inputs/trivial.obj.coff-x86-64 | FileCheck %s
+# RUN: llvm-readobj -x 1 %p/Inputs/trivial.obj.coff-x86-64 | FileCheck %s
+
+# CHECK: 0x00000000 4883ec28 488d0d00 000000e8 00000000 H..(H...........
+# CHECK: 0x00000010 e8000000 0031c048 83c428c3 .....1.H..(.
diff --git a/llvm/test/tools/llvm-readobj/COFF/relocations.test b/llvm/test/tools/llvm-readobj/COFF/relocations.test
new file mode 100644
index 000000000000..5644e734bb00
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/COFF/relocations.test
@@ -0,0 +1,22 @@
+## Check how we print relocations.
+
+# RUN: llvm-readobj -r %p/Inputs/trivial.obj.coff-i386 \
+# RUN: | FileCheck %s --check-prefix COFF
+# RUN: llvm-readobj -r %p/Inputs/bad-relocs.obj.coff-i386 \
+# RUN: | FileCheck %s --check-prefix BAD-COFF-RELOCS
+# RUN: llvm-readobj -r %p/Inputs/relocs-no-symtab.obj.coff-i386 \
+# RUN: | FileCheck %s --check-prefix BAD-COFF-RELOCS
+
+# COFF: Relocations [
+# COFF-NEXT: Section (1) .text {
+# COFF-NEXT: 0x4 IMAGE_REL_I386_DIR32 .data (4)
+# COFF-NEXT: 0x9 IMAGE_REL_I386_REL32 _puts (7)
+# COFF-NEXT: 0xE IMAGE_REL_I386_REL32 _SomeOtherFunction (8)
+# COFF-NEXT: }
+# COFF-NEXT: ]
+
+# BAD-COFF-RELOCS: Relocations [
+# BAD-COFF-RELOCS-NEXT: Section (1) sec {
+# BAD-COFF-RELOCS-NEXT: 0xDEADBEEF IMAGE_REL_I386_ABSOLUTE -
+# BAD-COFF-RELOCS-NEXT: }
+# BAD-COFF-RELOCS-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/COFF/sections-ext.test b/llvm/test/tools/llvm-readobj/COFF/sections-ext.test
new file mode 100644
index 000000000000..b07347a2b472
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/COFF/sections-ext.test
@@ -0,0 +1,63 @@
+## This is a test case for --section-symbols, --section-relocations
+## and --section-data command line options and their aliases.
+
+# RUN: llvm-readobj -S --st --sr --sd %p/Inputs/trivial.obj.coff-i386 | FileCheck %s
+# RUN: llvm-readobj -S --section-symbols --section-relocations --section-data \
+# RUN: %p/Inputs/trivial.obj.coff-i386 | FileCheck %s
+
+# CHECK: Sections [
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Number: 1
+# CHECK-NEXT: Name: .text (2E 74 65 78 74 00 00 00)
+# CHECK-NEXT: VirtualSize: 0x0
+# CHECK-NEXT: VirtualAddress: 0x0
+# CHECK-NEXT: RawDataSize: 22
+# CHECK-NEXT: PointerToRawData: 0x64
+# CHECK-NEXT: PointerToRelocations: 0x7A
+# CHECK-NEXT: PointerToLineNumbers: 0x0
+# CHECK-NEXT: RelocationCount: 3
+# CHECK-NEXT: LineNumberCount: 0
+# CHECK-NEXT: Characteristics [ (0x60500020)
+# CHECK-NEXT: IMAGE_SCN_ALIGN_16BYTES (0x500000)
+# CHECK-NEXT: IMAGE_SCN_CNT_CODE (0x20)
+# CHECK-NEXT: IMAGE_SCN_MEM_EXECUTE (0x20000000)
+# CHECK-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Relocations [
+# CHECK-NEXT: 0x4 IMAGE_REL_I386_DIR32 .data
+# CHECK-NEXT: 0x9 IMAGE_REL_I386_REL32 _puts
+# CHECK-NEXT: 0xE IMAGE_REL_I386_REL32 _SomeOtherFunction
+# CHECK-NEXT: ]
+# CHECK-NEXT: Symbols [
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: .text
+# CHECK-NEXT: Value: 0
+# CHECK-NEXT: Section: .text (1)
+# CHECK-NEXT: BaseType: Null (0x0)
+# CHECK-NEXT: ComplexType: Null (0x0)
+# CHECK-NEXT: StorageClass: Static (0x3)
+# CHECK-NEXT: AuxSymbolCount: 1
+# CHECK-NEXT: AuxSectionDef {
+# CHECK-NEXT: Length: 22
+# CHECK-NEXT: RelocationCount: 3
+# CHECK-NEXT: LineNumberCount: 0
+# CHECK-NEXT: Checksum: 0x0
+# CHECK-NEXT: Number: 1
+# CHECK-NEXT: Selection: 0x0
+# CHECK-NEXT: }
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: _main
+# CHECK-NEXT: Value: 0
+# CHECK-NEXT: Section: .text (1)
+# CHECK-NEXT: BaseType: Null (0x0)
+# CHECK-NEXT: ComplexType: Function (0x2)
+# CHECK-NEXT: StorageClass: External (0x2)
+# CHECK-NEXT: AuxSymbolCount: 0
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
+# CHECK-NEXT: SectionData (
+# CHECK-NEXT: 0000: 50C70424 00000000 E8000000 00E80000 |P..$............|
+# CHECK-NEXT: 0010: 000031C0 5AC3 |..1.Z.|
+# CHECK-NEXT: )
+# CHECK-NEXT: }
diff --git a/llvm/test/tools/llvm-readobj/COFF/sections.test b/llvm/test/tools/llvm-readobj/COFF/sections.test
new file mode 100644
index 000000000000..826cc60c8be1
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/COFF/sections.test
@@ -0,0 +1,42 @@
+## Check how we print sections.
+
+# RUN: llvm-readobj --sections %p/Inputs/trivial.obj.coff-i386 | FileCheck %s
+
+# CHECK: Sections [
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Number: 1
+# CHECK-NEXT: Name: .text (2E 74 65 78 74 00 00 00)
+# CHECK-NEXT: VirtualSize: 0x0
+# CHECK-NEXT: VirtualAddress: 0x0
+# CHECK-NEXT: RawDataSize: 22
+# CHECK-NEXT: PointerToRawData: 0x64
+# CHECK-NEXT: PointerToRelocations: 0x7A
+# CHECK-NEXT: PointerToLineNumbers: 0x0
+# CHECK-NEXT: RelocationCount: 3
+# CHECK-NEXT: LineNumberCount: 0
+# CHECK-NEXT: Characteristics [ (0x60500020)
+# CHECK-NEXT: IMAGE_SCN_ALIGN_16BYTES (0x500000)
+# CHECK-NEXT: IMAGE_SCN_CNT_CODE (0x20)
+# CHECK-NEXT: IMAGE_SCN_MEM_EXECUTE (0x20000000)
+# CHECK-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
+# CHECK-NEXT: ]
+# CHECK-NEXT: }
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Number: 2
+# CHECK-NEXT: Name: .data (2E 64 61 74 61 00 00 00)
+# CHECK-NEXT: VirtualSize: 0x0
+# CHECK-NEXT: VirtualAddress: 0x0
+# CHECK-NEXT: RawDataSize: 13
+# CHECK-NEXT: PointerToRawData: 0x98
+# CHECK-NEXT: PointerToRelocations: 0x0
+# CHECK-NEXT: PointerToLineNumbers: 0x0
+# CHECK-NEXT: RelocationCount: 0
+# CHECK-NEXT: LineNumberCount: 0
+# CHECK-NEXT: Characteristics [ (0xC0300040)
+# CHECK-NEXT: IMAGE_SCN_ALIGN_4BYTES (0x300000)
+# CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)
+# CHECK-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
+# CHECK-NEXT: IMAGE_SCN_MEM_WRITE (0x80000000)
+# CHECK-NEXT: ]
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/COFF/symbols.test b/llvm/test/tools/llvm-readobj/COFF/symbols.test
new file mode 100644
index 000000000000..2e808f33613e
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/COFF/symbols.test
@@ -0,0 +1,40 @@
+## Test how we print symbols.
+
+# RUN: llvm-readobj --symbols %p/Inputs/trivial.obj.coff-i386 | FileCheck %s
+
+# CHECK: Symbols [
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: @comp.id
+# CHECK-NEXT: Value: 14766605
+# CHECK-NEXT: Section: IMAGE_SYM_ABSOLUTE (-1)
+# CHECK-NEXT: BaseType: Null (0x0)
+# CHECK-NEXT: ComplexType: Null (0x0)
+# CHECK-NEXT: StorageClass: Static (0x3)
+# CHECK-NEXT: AuxSymbolCount: 0
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: @feat.00
+# CHECK-NEXT: Value: 2147484049
+# CHECK-NEXT: Section: IMAGE_SYM_ABSOLUTE (-1)
+# CHECK-NEXT: BaseType: Null (0x0)
+# CHECK-NEXT: ComplexType: Null (0x0)
+# CHECK-NEXT: StorageClass: Static (0x3)
+# CHECK-NEXT: AuxSymbolCount: 0
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: .text
+# CHECK-NEXT: Value: 0
+# CHECK-NEXT: Section: .text (1)
+# CHECK-NEXT: BaseType: Null (0x0)
+# CHECK-NEXT: ComplexType: Null (0x0)
+# CHECK-NEXT: StorageClass: Static (0x3)
+# CHECK-NEXT: AuxSymbolCount: 1
+# CHECK-NEXT: AuxSectionDef {
+# CHECK-NEXT: Length: 22
+# CHECK-NEXT: RelocationCount: 3
+# CHECK-NEXT: LineNumberCount: 0
+# CHECK-NEXT: Checksum: 0x0
+# CHECK-NEXT: Number: 1
+# CHECK-NEXT: Selection: 0x0
+# CHECK-NEXT: }
+# CHECK-NEXT: }
diff --git a/llvm/test/tools/llvm-readobj/ELF/basic.test b/llvm/test/tools/llvm-readobj/ELF/basic.test
new file mode 100644
index 000000000000..1d273b8b927f
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/ELF/basic.test
@@ -0,0 +1,19 @@
+## Test the case where no switches are specified.
+
+# RUN: yaml2obj %s -o %t.trivial.obj.elf-x86-64
+# RUN: llvm-readobj %t.trivial.obj.elf-x86-64 | FileCheck --check-prefix=HEADER %s
+# RUN: llvm-readelf %t.trivial.obj.elf-x86-64 | FileCheck --check-prefix=NO-OUTPUT --allow-empty %s
+
+# HEADER: File: {{.*}}trivial.obj.elf-x86-64
+# HEADER: Format: ELF64-x86-64
+# HEADER: Arch: x86_64
+# HEADER: AddressSize: 64bit
+
+# NO-OUTPUT-NOT: {{.}}
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
diff --git a/llvm/test/tools/llvm-readobj/ELF/hex-dump.test b/llvm/test/tools/llvm-readobj/ELF/hex-dump.test
new file mode 100644
index 000000000000..968ed910e33e
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/ELF/hex-dump.test
@@ -0,0 +1,54 @@
+## Test that the -x alias can be used flexibly. Create a baseline and ensure
+## all other combinations are identical.
+# RUN: llvm-readelf --file-header --hex-dump=.text \
+# RUN: %p/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.out
+# RUN: llvm-readelf -h --hex-dump .text %p/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.1
+# RUN: llvm-readelf -h -x .text %p/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.2
+# RUN: llvm-readelf -h -x=.text %p/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.3
+# RUN: llvm-readelf -h -x.text %p/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.4
+# RUN: llvm-readelf -hx .text %p/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.5
+# RUN: llvm-readelf -hx=.text %p/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.6
+# RUN: llvm-readelf -hx.text %p/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.7
+
+# RUN: cmp %t.hexdump.out %t.hexdump.1
+# RUN: cmp %t.hexdump.out %t.hexdump.2
+# RUN: cmp %t.hexdump.out %t.hexdump.3
+# RUN: cmp %t.hexdump.out %t.hexdump.4
+# RUN: cmp %t.hexdump.out %t.hexdump.5
+# RUN: cmp %t.hexdump.out %t.hexdump.6
+# RUN: cmp %t.hexdump.out %t.hexdump.7
+
+# RUN: llvm-readelf -S %p/Inputs/trivial.obj.elf-x86-64 | FileCheck %s --check-prefix=ELF-SEC
+
+## Both 9 and .strtab refer to .strtab. Test we dump the section only once.
+# RUN: llvm-readobj -x 9 -x 9 -x .strtab -x .strtab %p/Inputs/trivial.obj.elf-x86-64 2>&1 | \
+# RUN: FileCheck %s --check-prefix=ELF
+# RUN: llvm-readobj -x 9 -x .strtab -x 10 -x not_exist \
+# RUN: %p/Inputs/trivial.obj.elf-x86-64 2>&1 | FileCheck %s -DFILE=%p/Inputs/trivial.obj.elf-x86-64 --check-prefixes=ELF-WARN,ELF
+
+# ELF-SEC: [ 9] .strtab
+
+# ELF-WARN: warning: '[[FILE]]': could not find section 'not_exist'
+# ELF-WARN: warning: '[[FILE]]': could not find section 10
+# ELF: Hex dump of section '.strtab':
+# ELF-NEXT: 0x00000000 00747269 7669616c 2e6c6c00 6d61696e .trivial.ll.main
+# ELF-NEXT: 0x00000010 002e4c2e 73747200 70757473 00536f6d ..L.str.puts.Som
+# ELF-NEXT: 0x00000020 654f7468 65724675 6e637469 6f6e005f eOtherFunction._
+# ELF-NEXT: 0x00000030 474c4f42 414c5f4f 46465345 545f5441 GLOBAL_OFFSET_TA
+# ELF-NEXT: 0x00000040 424c455f 00 BLE_.
+# ELF-NOT: {{.}}
+
+## This test shows that we include the tool name in an error/warning message.
+
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-readelf -x 10 %t 2>&1 | FileCheck --check-prefix=WARN %s -DTOOL=readelf
+# RUN: llvm-readobj -x 10 %t 2>&1 | FileCheck --check-prefix=WARN %s -DTOOL=readobj
+
+# WARN: llvm-[[TOOL]]{{(\.exe)?}}: warning: '{{.*}}': could not find section 10
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_DYN
+ Machine: EM_RISCV
diff --git a/llvm/test/tools/llvm-readobj/elf-relocations.test b/llvm/test/tools/llvm-readobj/ELF/relocations.test
similarity index 100%
rename from llvm/test/tools/llvm-readobj/elf-relocations.test
rename to llvm/test/tools/llvm-readobj/ELF/relocations.test
diff --git a/llvm/test/tools/llvm-readobj/ELF/sections-ext.test b/llvm/test/tools/llvm-readobj/ELF/sections-ext.test
new file mode 100644
index 000000000000..8e3bc2a7e24d
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/ELF/sections-ext.test
@@ -0,0 +1,110 @@
+## This is a test case for --section-symbols, --section-relocations and
+## --section-data command line flags and their aliases.
+
+# RUN: llvm-readobj -S --st --sr --sd %p/Inputs/trivial.obj.elf-i386
+
+## Check the two-letter aliases above (--st, --sr, --sd) are equivalent to their
+## full flag names.
+
+# RUN: llvm-readobj -S --st %p/Inputs/trivial.obj.elf-i386 > %t.readobj-st-alias
+# RUN: llvm-readobj -S --section-symbols %p/Inputs/trivial.obj.elf-i386 > %t.readobj-st-no-alias
+# RUN:
diff %t.readobj-st-alias %t.readobj-st-no-alias
+
+# RUN: llvm-readobj -S --sr %p/Inputs/trivial.obj.elf-i386 > %t.readobj-sr-alias
+# RUN: llvm-readobj -S --section-relocations %p/Inputs/trivial.obj.elf-i386 > %t.readobj-sr-no-alias
+# RUN:
diff %t.readobj-sr-alias %t.readobj-sr-no-alias
+
+# RUN: llvm-readobj -S --sd %p/Inputs/trivial.obj.elf-i386 > %t.readobj-sd-alias
+# RUN: llvm-readobj -S --section-data %p/Inputs/trivial.obj.elf-i386 > %t.readobj-sd-no-alias
+# RUN:
diff %t.readobj-sd-alias %t.readobj-sd-no-alias
+
+# CHECK: Sections [
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Index: 0
+# CHECK-NEXT: Name: (0)
+# CHECK-NEXT: Type: SHT_NULL (0x0)
+# CHECK-NEXT: Flags [ (0x0)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Address: 0x0
+# CHECK-NEXT: Offset: 0x0
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Link: 0
+# CHECK-NEXT: Info: 0
+# CHECK-NEXT: AddressAlignment: 0
+# CHECK-NEXT: EntrySize: 0
+# CHECK-NEXT: Relocations [
+# CHECK-NEXT: ]
+# CHECK-NEXT: Symbols [
+# CHECK-NEXT: ]
+# CHECK-NEXT: SectionData (
+# CHECK-NEXT: )
+# CHECK-NEXT: }
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Index: 1
+# CHECK-NEXT: Name: .text (5)
+# CHECK-NEXT: Type: SHT_PROGBITS (0x1)
+# CHECK-NEXT: Flags [ (0x6)
+# CHECK-NEXT: SHF_ALLOC (0x2)
+# CHECK-NEXT: SHF_EXECINSTR (0x4)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Address: 0x0
+# CHECK-NEXT: Offset: 0x40
+# CHECK-NEXT: Size: 42
+# CHECK-NEXT: Link: 0
+# CHECK-NEXT: Info: 0
+# CHECK-NEXT: AddressAlignment: 16
+# CHECK-NEXT: EntrySize: 0
+# CHECK-NEXT: Relocations [
+# CHECK-NEXT: ]
+# CHECK-NEXT: Symbols [
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: .text (0)
+# CHECK-NEXT: Value: 0x0
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Local (0x0)
+# CHECK-NEXT: Type: Section (0x3)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .text (0x1)
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: main (12)
+# CHECK-NEXT: Value: 0x0
+# CHECK-NEXT: Size: 42
+# CHECK-NEXT: Binding: Global (0x1)
+# CHECK-NEXT: Type: Function (0x2)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .text (0x1)
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
+# CHECK-NEXT: SectionData (
+# CHECK-NEXT: 0000: 5383EC08 E8000000 005B81C3 03000000 |S........[......|
+# CHECK-NEXT: 0010: 8D830000 00008904 24E8FCFF FFFFE8FC |........$.......|
+# CHECK-NEXT: 0020: FFFFFF31 C083C408 5BC3 |...1....[.|
+# CHECK-NEXT: )
+# CHECK-NEXT: }
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Index: 2
+# CHECK-NEXT: Name: .rel.text (1)
+# CHECK-NEXT: Type: SHT_REL (0x9)
+# CHECK-NEXT: Flags [ (0x0)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Address: 0x0
+# CHECK-NEXT: Offset: 0x360
+# CHECK-NEXT: Size: 32
+# CHECK-NEXT: Link: 8
+# CHECK-NEXT: Info: 1
+# CHECK-NEXT: AddressAlignment: 4
+# CHECK-NEXT: EntrySize: 8
+# CHECK-NEXT: Relocations [
+# CHECK-NEXT: 0xC R_386_GOTPC _GLOBAL_OFFSET_TABLE_ 0x0
+# CHECK-NEXT: 0x12 R_386_GOTOFF .L.str 0x0
+# CHECK-NEXT: 0x1A R_386_PLT32 puts 0x0
+# CHECK-NEXT: 0x1F R_386_PLT32 SomeOtherFunction 0x0
+# CHECK-NEXT: ]
+# CHECK-NEXT: Symbols [
+# CHECK-NEXT: ]
+# CHECK-NEXT: SectionData (
+# CHECK-NEXT: 0000: 0C000000 0A0A0000 12000000 09020000 |................|
+# CHECK-NEXT: 0010: 1A000000 040B0000 1F000000 04090000 |................|
+# CHECK-NEXT: )
+# CHECK-NEXT: }
diff --git a/llvm/test/tools/llvm-readobj/ELF/sections.test b/llvm/test/tools/llvm-readobj/ELF/sections.test
new file mode 100644
index 000000000000..9eecd18545bc
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/ELF/sections.test
@@ -0,0 +1,76 @@
+## Check how we print sections.
+
+# RUN: llvm-readobj --sections %p/Inputs/trivial.obj.elf-i386 \
+# RUN: | FileCheck %s --check-prefix ELF
+# RUN: llvm-readobj --sections %p/Inputs/trivial.obj.elf-mipsel \
+# RUN: | FileCheck %s --check-prefix ELF-MIPSEL
+
+## Check flag aliases produce identical output.
+# RUN: llvm-readobj --sections %p/Inputs/trivial.obj.elf-i386 > %t.sections
+# RUN: llvm-readobj -S %p/Inputs/trivial.obj.elf-i386 > %t.uppers
+# RUN: cmp %t.sections %t.uppers
+# RUN: llvm-readobj -S %p/Inputs/trivial.obj.elf-i386 > %t.lowers
+# RUN: cmp %t.sections %t.lowers
+
+# ELF: Sections [
+# ELF-NEXT: Section {
+# ELF-NEXT: Index: 0
+# ELF-NEXT: Name: (0)
+# ELF-NEXT: Type: SHT_NULL (0x0)
+# ELF-NEXT: Flags [ (0x0)
+# ELF-NEXT: ]
+# ELF-NEXT: Address: 0x0
+# ELF-NEXT: Offset: 0x0
+# ELF-NEXT: Size: 0
+# ELF-NEXT: Link: 0
+# ELF-NEXT: Info: 0
+# ELF-NEXT: AddressAlignment: 0
+# ELF-NEXT: EntrySize: 0
+# ELF-NEXT: }
+# ELF-NEXT: Section {
+# ELF-NEXT: Index: 1
+# ELF-NEXT: Name: .text (5)
+# ELF-NEXT: Type: SHT_PROGBITS (0x1)
+# ELF-NEXT: Flags [ (0x6)
+# ELF-NEXT: SHF_ALLOC (0x2)
+# ELF-NEXT: SHF_EXECINSTR (0x4)
+# ELF-NEXT: ]
+# ELF-NEXT: Address: 0x0
+# ELF-NEXT: Offset: 0x40
+# ELF-NEXT: Size: 42
+# ELF-NEXT: Link: 0
+# ELF-NEXT: Info: 0
+# ELF-NEXT: AddressAlignment: 16
+# ELF-NEXT: EntrySize: 0
+# ELF-NEXT: }
+
+# ELF-MIPSEL: Section {
+# ELF-MIPSEL: Index: 4
+# ELF-MIPSEL-NEXT: Name: .reginfo (27)
+# ELF-MIPSEL-NEXT: Type: SHT_MIPS_REGINFO (0x70000006)
+# ELF-MIPSEL-NEXT: Flags [ (0x2)
+# ELF-MIPSEL-NEXT: SHF_ALLOC (0x2)
+# ELF-MIPSEL-NEXT: ]
+# ELF-MIPSEL-NEXT: Address: 0x0
+# ELF-MIPSEL-NEXT: Offset: 0x34
+# ELF-MIPSEL-NEXT: Size: 24
+# ELF-MIPSEL-NEXT: Link: 0
+# ELF-MIPSEL-NEXT: Info: 0
+# ELF-MIPSEL-NEXT: AddressAlignment: 1
+# ELF-MIPSEL-NEXT: EntrySize: 0
+# ELF-MIPSEL-NEXT: }
+# ELF-MIPSEL-NEXT: Section {
+# ELF-MIPSEL-NEXT: Index: 5
+# ELF-MIPSEL-NEXT: Name: .MIPS.abiflags (12)
+# ELF-MIPSEL-NEXT: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
+# ELF-MIPSEL-NEXT: Flags [ (0x2)
+# ELF-MIPSEL-NEXT: SHF_ALLOC (0x2)
+# ELF-MIPSEL-NEXT: ]
+# ELF-MIPSEL-NEXT: Address: 0x0
+# ELF-MIPSEL-NEXT: Offset: 0x50
+# ELF-MIPSEL-NEXT: Size: 24
+# ELF-MIPSEL-NEXT: Link: 0
+# ELF-MIPSEL-NEXT: Info: 0
+# ELF-MIPSEL-NEXT: AddressAlignment: 8
+# ELF-MIPSEL-NEXT: EntrySize: 0
+# ELF-MIPSEL-NEXT: }
diff --git a/llvm/test/tools/llvm-readobj/ELF/symbols.test b/llvm/test/tools/llvm-readobj/ELF/symbols.test
new file mode 100644
index 000000000000..31bb9ae7b2fe
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/ELF/symbols.test
@@ -0,0 +1,42 @@
+## This is a general test for --symbols option and its aliases.
+## There are also other symbols* tests that check specific things.
+
+# RUN: llvm-readobj --symbols %p/Inputs/trivial.obj.elf-i386 | FileCheck %s
+
+## Check flag aliases produce identical output.
+# RUN: llvm-readobj --symbols %p/Inputs/trivial.obj.elf-i386 > %t.symbols
+# RUN: llvm-readobj --syms %p/Inputs/trivial.obj.elf-i386 > %t.syms
+# RUN: cmp %t.symbols %t.syms
+# RUN: llvm-readobj -t %p/Inputs/trivial.obj.elf-i386 > %t.t
+# RUN: cmp %t.symbols %t.t
+# RUN: llvm-readelf -s --elf-output-style LLVM %p/Inputs/trivial.obj.elf-i386 > %t.lowers
+# RUN: cmp %t.symbols %t.lowers
+
+# CHECK: 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: trivial.ll (1)
+# CHECK-NEXT: Value: 0x0
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Local (0x0)
+# CHECK-NEXT: Type: File (0x4)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: Absolute (0xFFF1)
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: .L.str (39)
+# CHECK-NEXT: Value: 0x0
+# CHECK-NEXT: Size: 13
+# CHECK-NEXT: Binding: Local (0x0)
+# CHECK-NEXT: Type: Object (0x1)
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .rodata.str1.1 (0x5)
+# CHECK-NEXT: }
diff --git a/llvm/test/tools/llvm-readobj/MachO/hex-dump.test b/llvm/test/tools/llvm-readobj/MachO/hex-dump.test
new file mode 100644
index 000000000000..c2895d46d31a
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/MachO/hex-dump.test
@@ -0,0 +1,8 @@
+## Test that --hex-dump/-x can be used to display the contents
+## of the indicated section as hexadecimal bytes.
+
+# RUN: llvm-readobj -x 1 %p/Inputs/trivial.obj.macho-x86-64 | FileCheck %s
+# RUN: llvm-readobj --hex-dump 1 %p/Inputs/trivial.obj.macho-x86-64 | FileCheck %s
+
+# CHECK: 0x00000000 50488d3d 00000000 e8000000 00e80000 PH.=............
+# CHECK: 0x00000010 000031c0 5ac3 ..1.Z.
diff --git a/llvm/test/tools/llvm-readobj/MachO/relocations.test b/llvm/test/tools/llvm-readobj/MachO/relocations.test
new file mode 100644
index 000000000000..b2e9a4df92ff
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/MachO/relocations.test
@@ -0,0 +1,255 @@
+## Check how we print relocations.
+
+# RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-i386 \
+# RUN: | FileCheck %s --check-prefix MACHO-I386
+# RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-x86-64 \
+# RUN: | FileCheck %s --check-prefix MACHO-X86-64
+# RUN: llvm-readobj -r --expand-relocs %p/Inputs/trivial.obj.macho-ppc \
+# RUN: | FileCheck %s --check-prefix MACHO-PPC
+# RUN: llvm-readobj -r --expand-relocs %p/Inputs/trivial.obj.macho-ppc64 \
+# RUN: | FileCheck %s --check-prefix MACHO-PPC64
+# RUN: llvm-readobj -r --expand-relocs %p/Inputs/trivial.obj.macho-arm \
+# RUN: | FileCheck %s --check-prefix MACHO-ARM
+
+# MACHO-I386: Relocations [
+# MACHO-I386-NEXT: Section __text {
+# MACHO-I386-NEXT: 0x18 1 2 1 GENERIC_RELOC_VANILLA 0 _SomeOtherFunction
+# MACHO-I386-NEXT: 0x13 1 2 1 GENERIC_RELOC_VANILLA 0 _puts
+# MACHO-I386-NEXT: 0xB 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 0x22
+# MACHO-I386-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 0x8
+# MACHO-I386-NEXT: }
+# MACHO-I386-NEXT: ]
+
+# MACHO-X86-64: Relocations [
+# MACHO-X86-64-NEXT: Section __text {
+# MACHO-X86-64-NEXT: 0xE 1 2 1 X86_64_RELOC_BRANCH 0 _SomeOtherFunction
+# MACHO-X86-64-NEXT: 0x9 1 2 1 X86_64_RELOC_BRANCH 0 _puts
+# MACHO-X86-64-NEXT: 0x4 1 2 1 X86_64_RELOC_SIGNED 0 L_.str
+# MACHO-X86-64-NEXT: }
+# MACHO-X86-64-NEXT:]
+
+# MACHO-PPC: Relocations [
+# MACHO-PPC-NEXT: Section __text {
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x24
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_LO16_SECTDIFF (11)
+# MACHO-PPC-NEXT: Value: 0x64
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x0
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
+# MACHO-PPC-NEXT: Value: 0xC
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x1C
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_HA16_SECTDIFF (12)
+# MACHO-PPC-NEXT: Value: 0x64
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x58
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
+# MACHO-PPC-NEXT: Value: 0xC
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x18
+# MACHO-PPC-NEXT: PCRel: 1
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_BR24 (3)
+# MACHO-PPC-NEXT: Section: __picsymbolstub1 (2)
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Section __picsymbolstub1 {
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x14
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_LO16_SECTDIFF (11)
+# MACHO-PPC-NEXT: Value: 0x68
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x0
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
+# MACHO-PPC-NEXT: Value: 0x48
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0xC
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_HA16_SECTDIFF (12)
+# MACHO-PPC-NEXT: Value: 0x68
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x20
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
+# MACHO-PPC-NEXT: Value: 0x48
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Section __la_symbol_ptr {
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x0
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_VANILLA (0)
+# MACHO-PPC-NEXT: Symbol: dyld_stub_binding_helper (5)
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: ]
+
+# MACHO-PPC64: Relocations [
+# MACHO-PPC64-NEXT: Section __text {
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x24
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (14)
+# MACHO-PPC64-NEXT: Value: 0x64
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x0
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (1)
+# MACHO-PPC64-NEXT: Value: 0xC
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x1C
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (12)
+# MACHO-PPC64-NEXT: Value: 0x64
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x58
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (1)
+# MACHO-PPC64-NEXT: Value: 0xC
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x18
+# MACHO-PPC64-NEXT: PCRel: 1
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (3)
+# MACHO-PPC64-NEXT: Section: __picsymbolstub1 (2)
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Section __picsymbolstub1 {
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x14
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (14)
+# MACHO-PPC64-NEXT: Value: 0x6C
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x0
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (1)
+# MACHO-PPC64-NEXT: Value: 0x48
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0xC
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (12)
+# MACHO-PPC64-NEXT: Value: 0x6C
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x24
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (1)
+# MACHO-PPC64-NEXT: Value: 0x48
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Section __la_symbol_ptr {
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x0
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 3
+# MACHO-PPC64-NEXT: Type: (0)
+# MACHO-PPC64-NEXT: Symbol: dyld_stub_binding_helper (5)
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: ]
+
+# MACHO-ARM: Relocations [
+# MACHO-ARM-NEXT: Section __text {
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x38
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 2
+# MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
+# MACHO-ARM-NEXT: Value: 0x40
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x0
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 2
+# MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+# MACHO-ARM-NEXT: Value: 0x28
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x20
+# MACHO-ARM-NEXT: PCRel: 1
+# MACHO-ARM-NEXT: Length: 2
+# MACHO-ARM-NEXT: Type: ARM_RELOC_BR24 (5)
+# MACHO-ARM-NEXT: Symbol: _g
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x1C
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 1
+# MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
+# MACHO-ARM-NEXT: Symbol: _g
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x0
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 1
+# MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+# MACHO-ARM-NEXT: Section: -
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x18
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 0
+# MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
+# MACHO-ARM-NEXT: Symbol: _g
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x0
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 0
+# MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+# MACHO-ARM-NEXT: Section: -
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0xC
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 2
+# MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
+# MACHO-ARM-NEXT: Value: 0x44
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x0
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 2
+# MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+# MACHO-ARM-NEXT: Value: 0x4
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/MachO/sections-ext.test b/llvm/test/tools/llvm-readobj/MachO/sections-ext.test
new file mode 100644
index 000000000000..c02ef34a9e76
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/MachO/sections-ext.test
@@ -0,0 +1,843 @@
+## This is a test case for --section-symbols, --section-relocations and
+## --section-data command line options.
+
+# RUN: llvm-readobj -S --section-symbols --section-relocations --section-data \
+# RUN: %p/Inputs/trivial.obj.macho-i386 | FileCheck %s --check-prefix MACHO-I386
+# RUN: llvm-readobj -S --st --sr --sd %p/Inputs/trivial.obj.macho-i386 \
+# RUN: | FileCheck %s --check-prefix MACHO-I386
+
+# RUN: llvm-readobj -S --section-symbols --section-relocations --section-data \
+# RUN: %p/Inputs/trivial.obj.macho-x86-64 | FileCheck %s --check-prefix MACHO-X86-64
+# RUN: llvm-readobj -S --st --sr --sd %p/Inputs/trivial.obj.macho-x86-64 \
+# RUN: | FileCheck %s --check-prefix MACHO-X86-64
+
+# RUN: llvm-readobj --expand-relocs -S --section-symbols --section-relocations --section-data \
+# RUN: %p/Inputs/trivial.obj.macho-ppc | FileCheck %s --check-prefix MACHO-PPC
+# RUN: llvm-readobj --expand-relocs -S --st --sr --sd %p/Inputs/trivial.obj.macho-ppc \
+# RUN: | FileCheck %s --check-prefix MACHO-PPC
+
+# RUN: llvm-readobj --expand-relocs -S --section-symbols --section-relocations --section-data \
+# RUN: %p/Inputs/trivial.obj.macho-ppc64 | FileCheck %s --check-prefix MACHO-PPC64
+# RUN: llvm-readobj --expand-relocs -S --st --sr --sd %p/Inputs/trivial.obj.macho-ppc64 \
+# RUN: | FileCheck %s --check-prefix MACHO-PPC64
+
+# RUN: llvm-readobj --expand-relocs -S --section-symbols --section-relocations --section-data \
+# RUN: %p/Inputs/trivial.obj.macho-arm | FileCheck %s --check-prefix MACHO-ARM
+# RUN: llvm-readobj --expand-relocs -S --st --sr --sd %p/Inputs/trivial.obj.macho-arm \
+# RUN: | FileCheck %s --check-prefix MACHO-ARM
+
+# MACHO-I386: Sections [
+# MACHO-I386-NEXT: Section {
+# MACHO-I386-NEXT: Index: 0
+# MACHO-I386-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+# MACHO-I386-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-I386-NEXT: Address: 0x0
+# MACHO-I386-NEXT: Size: 0x22
+# MACHO-I386-NEXT: Offset: 324
+# MACHO-I386-NEXT: Alignment: 4
+# MACHO-I386-NEXT: RelocationOffset: 0x174
+# MACHO-I386-NEXT: RelocationCount: 4
+# MACHO-I386-NEXT: Type: Regular (0x0)
+# MACHO-I386-NEXT: Attributes [ (0x800004)
+# MACHO-I386-NEXT: PureInstructions (0x800000)
+# MACHO-I386-NEXT: SomeInstructions (0x4)
+# MACHO-I386-NEXT: ]
+# MACHO-I386-NEXT: Reserved1: 0x0
+# MACHO-I386-NEXT: Reserved2: 0x0
+# MACHO-I386-NEXT: Relocations [
+# MACHO-I386-NEXT: 0x18 1 2 1 GENERIC_RELOC_VANILLA 0 _SomeOtherFunction
+# MACHO-I386-NEXT: 0x13 1 2 1 GENERIC_RELOC_VANILLA 0 _puts
+# MACHO-I386-NEXT: 0xB 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 0x22
+# MACHO-I386-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 0x8
+# MACHO-I386-NEXT: ]
+# MACHO-I386-NEXT: Symbols [
+# MACHO-I386-NEXT: Symbol {
+# MACHO-I386-NEXT: Name: _main (1)
+# MACHO-I386-NEXT: Extern
+# MACHO-I386-NEXT: Type: Section (0xE)
+# MACHO-I386-NEXT: Section: __text (0x1)
+# MACHO-I386-NEXT: RefType: UndefinedNonLazy (0x0)
+# MACHO-I386-NEXT: Flags [ (0x0)
+# MACHO-I386-NEXT: ]
+# MACHO-I386-NEXT: Value: 0x0
+# MACHO-I386-NEXT: }
+# MACHO-I386-NEXT: ]
+# MACHO-I386-NEXT: SectionData (
+# MACHO-I386-NEXT: 0000: 83EC0CE8 00000000 588D801A 00000089 |........X.......|
+# MACHO-I386-NEXT: 0010: 0424E8E9 FFFFFFE8 E4FFFFFF 31C083C4 |.$..........1...|
+# MACHO-I386-NEXT: 0020: 0CC3 |..|
+# MACHO-I386-NEXT: )
+# MACHO-I386-NEXT: }
+
+# MACHO-X86-64: Sections [
+# MACHO-X86-64-NEXT: Section {
+# MACHO-X86-64-NEXT: Index: 0
+# MACHO-X86-64-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+# MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-X86-64-NEXT: Address: 0x0
+# MACHO-X86-64-NEXT: Size: 0x16
+# MACHO-X86-64-NEXT: Offset: 368
+# MACHO-X86-64-NEXT: Alignment: 4
+# MACHO-X86-64-NEXT: RelocationOffset: 0x194
+# MACHO-X86-64-NEXT: RelocationCount: 3
+# MACHO-X86-64-NEXT: Type: Regular (0x0)
+# MACHO-X86-64-NEXT: Attributes [ (0x800004)
+# MACHO-X86-64-NEXT: PureInstructions (0x800000)
+# MACHO-X86-64-NEXT: SomeInstructions (0x4)
+# MACHO-X86-64-NEXT: ]
+# MACHO-X86-64-NEXT: Reserved1: 0x0
+# MACHO-X86-64-NEXT: Reserved2: 0x0
+# MACHO-X86-64-NEXT: Reserved3: 0x0
+# MACHO-X86-64-NEXT: Relocations [
+# MACHO-X86-64-NEXT: 0xE 1 2 1 X86_64_RELOC_BRANCH 0 _SomeOtherFunction
+# MACHO-X86-64-NEXT: 0x9 1 2 1 X86_64_RELOC_BRANCH 0 _puts
+# MACHO-X86-64-NEXT: 0x4 1 2 1 X86_64_RELOC_SIGNED 0 L_.str
+# MACHO-X86-64-NEXT: ]
+# MACHO-X86-64-NEXT: Symbols [
+# MACHO-X86-64-NEXT: Symbol {
+# MACHO-X86-64-NEXT: Name: _main (1)
+# MACHO-X86-64-NEXT: Extern
+# MACHO-X86-64-NEXT: Type: Section (0xE)
+# MACHO-X86-64-NEXT: Section: __text (0x1)
+# MACHO-X86-64-NEXT: RefType: UndefinedNonLazy (0x0)
+# MACHO-X86-64-NEXT: Flags [ (0x0)
+# MACHO-X86-64-NEXT: ]
+# MACHO-X86-64-NEXT: Value: 0x0
+# MACHO-X86-64-NEXT: }
+# MACHO-X86-64-NEXT: ]
+# MACHO-X86-64-NEXT: SectionData (
+# MACHO-X86-64-NEXT: 0000: 50488D3D 00000000 E8000000 00E80000 |PH.=............|
+# MACHO-X86-64-NEXT: 0010: 000031C0 5AC3 |..1.Z.|
+# MACHO-X86-64-NEXT: )
+# MACHO-X86-64-NEXT: }
+# MACHO-X86-64-NEXT: Section {
+# MACHO-X86-64-NEXT: Index: 1
+# MACHO-X86-64-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
+# MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-X86-64-NEXT: Address: 0x16
+# MACHO-X86-64-NEXT: Size: 0xD
+# MACHO-X86-64-NEXT: Offset: 390
+# MACHO-X86-64-NEXT: Alignment: 0
+# MACHO-X86-64-NEXT: RelocationOffset: 0x0
+# MACHO-X86-64-NEXT: RelocationCount: 0
+# MACHO-X86-64-NEXT: Type: CStringLiterals (0x2)
+# MACHO-X86-64-NEXT: Attributes [ (0x0)
+# MACHO-X86-64-NEXT: ]
+# MACHO-X86-64-NEXT: Reserved1: 0x0
+# MACHO-X86-64-NEXT: Reserved2: 0x0
+# MACHO-X86-64-NEXT: Reserved3: 0x0
+# MACHO-X86-64-NEXT: Relocations [
+# MACHO-X86-64-NEXT: ]
+# MACHO-X86-64-NEXT: Symbols [
+# MACHO-X86-64-NEXT: Symbol {
+# MACHO-X86-64-NEXT: Name: L_.str (32)
+# MACHO-X86-64-NEXT: Type: Section (0xE)
+# MACHO-X86-64-NEXT: Section: __cstring (0x2)
+# MACHO-X86-64-NEXT: RefType: UndefinedNonLazy (0x0)
+# MACHO-X86-64-NEXT: Flags [ (0x0)
+# MACHO-X86-64-NEXT: ]
+# MACHO-X86-64-NEXT: Value: 0x16
+# MACHO-X86-64-NEXT: }
+# MACHO-X86-64-NEXT: ]
+# MACHO-X86-64-NEXT: SectionData (
+# MACHO-X86-64-NEXT: 0000: 48656C6C 6F20576F 726C640A 00 |Hello World..|
+# MACHO-X86-64-NEXT: )
+# MACHO-X86-64-NEXT: }
+# MACHO-X86-64-NEXT:]
+
+# MACHO-PPC: Sections [
+# MACHO-PPC-NEXT: Section {
+# MACHO-PPC-NEXT: Index: 0
+# MACHO-PPC-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Address: 0x0
+# MACHO-PPC-NEXT: Size: 0x3C
+# MACHO-PPC-NEXT: Offset: 528
+# MACHO-PPC-NEXT: Alignment: 2
+# MACHO-PPC-NEXT: RelocationOffset: 0x27C
+# MACHO-PPC-NEXT: RelocationCount: 5
+# MACHO-PPC-NEXT: Type: Regular (0x0)
+# MACHO-PPC-NEXT: Attributes [ (0x800004)
+# MACHO-PPC-NEXT: PureInstructions (0x800000)
+# MACHO-PPC-NEXT: SomeInstructions (0x4)
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Reserved1: 0x0
+# MACHO-PPC-NEXT: Reserved2: 0x0
+# MACHO-PPC-NEXT: Relocations [
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x24
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_LO16_SECTDIFF (11)
+# MACHO-PPC-NEXT: Value: 0x64
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x0
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
+# MACHO-PPC-NEXT: Value: 0xC
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x1C
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_HA16_SECTDIFF (12)
+# MACHO-PPC-NEXT: Value: 0x64
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x58
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
+# MACHO-PPC-NEXT: Value: 0xC
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x18
+# MACHO-PPC-NEXT: PCRel: 1
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_BR24 (3)
+# MACHO-PPC-NEXT: Section: __picsymbolstub1 (2)
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Symbols [
+# MACHO-PPC-NEXT: Symbol {
+# MACHO-PPC-NEXT: Name: _f (4)
+# MACHO-PPC-NEXT: Extern
+# MACHO-PPC-NEXT: Type: Section (0xE)
+# MACHO-PPC-NEXT: Section: __text (0x1)
+# MACHO-PPC-NEXT: RefType: UndefinedNonLazy (0x0)
+# MACHO-PPC-NEXT: Flags [ (0x0)
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Value: 0x0
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: SectionData (
+# MACHO-PPC-NEXT: 0000: 7C0802A6 93E1FFFC 429F0005 7FE802A6 ||.......B.......|
+# MACHO-PPC-NEXT: 0010: 90010008 9421FFB0 48000029 3C5F0000 |.....!..H..)<_..|
+# MACHO-PPC-NEXT: 0020: 38210050 80420058 80010008 83E1FFFC |8!.P.B.X........|
+# MACHO-PPC-NEXT: 0030: 7C0803A6 80620000 4E800020 ||....b..N.. |
+# MACHO-PPC-NEXT: )
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Section {
+# MACHO-PPC-NEXT: Index: 1
+# MACHO-PPC-NEXT: Name: __picsymbolstub1 (5F 5F 70 69 63 73 79 6D 62 6F 6C 73 74 75 62 31)
+# MACHO-PPC-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Address: 0x40
+# MACHO-PPC-NEXT: Size: 0x20
+# MACHO-PPC-NEXT: Offset: 592
+# MACHO-PPC-NEXT: Alignment: 5
+# MACHO-PPC-NEXT: RelocationOffset: 0x2A4
+# MACHO-PPC-NEXT: RelocationCount: 4
+# MACHO-PPC-NEXT: Type: SymbolStubs (0x8)
+# MACHO-PPC-NEXT: Attributes [ (0x800004)
+# MACHO-PPC-NEXT: PureInstructions (0x800000)
+# MACHO-PPC-NEXT: SomeInstructions (0x4)
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Reserved1: 0x0
+# MACHO-PPC-NEXT: Reserved2: 0x20
+# MACHO-PPC-NEXT: Relocations [
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x14
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_LO16_SECTDIFF (11)
+# MACHO-PPC-NEXT: Value: 0x68
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x0
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
+# MACHO-PPC-NEXT: Value: 0x48
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0xC
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_HA16_SECTDIFF (12)
+# MACHO-PPC-NEXT: Value: 0x68
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x20
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
+# MACHO-PPC-NEXT: Value: 0x48
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Symbols [
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: SectionData (
+# MACHO-PPC-NEXT: 0000: 7C0802A6 429F0005 7D6802A6 3D6B0000 ||...B...}h..=k..|
+# MACHO-PPC-NEXT: 0010: 7C0803A6 858B0020 7D8903A6 4E800420 ||...... }...N.. |
+# MACHO-PPC-NEXT: )
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Section {
+# MACHO-PPC-NEXT: Index: 2
+# MACHO-PPC-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Address: 0x60
+# MACHO-PPC-NEXT: Size: 0x4
+# MACHO-PPC-NEXT: Offset: 624
+# MACHO-PPC-NEXT: Alignment: 2
+# MACHO-PPC-NEXT: RelocationOffset: 0x0
+# MACHO-PPC-NEXT: RelocationCount: 0
+# MACHO-PPC-NEXT: Type: Regular (0x0)
+# MACHO-PPC-NEXT: Attributes [ (0x0)
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Reserved1: 0x0
+# MACHO-PPC-NEXT: Reserved2: 0x0
+# MACHO-PPC-NEXT: Relocations [
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Symbols [
+# MACHO-PPC-NEXT: Symbol {
+# MACHO-PPC-NEXT: Name: _b (1)
+# MACHO-PPC-NEXT: Extern
+# MACHO-PPC-NEXT: Type: Section (0xE)
+# MACHO-PPC-NEXT: Section: __data (0x3)
+# MACHO-PPC-NEXT: RefType: UndefinedNonLazy (0x0)
+# MACHO-PPC-NEXT: Flags [ (0x0)
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Value: 0x60
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: SectionData (
+# MACHO-PPC-NEXT: 0000: 0000002A |...*|
+# MACHO-PPC-NEXT: )
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Section {
+# MACHO-PPC-NEXT: Index: 3
+# MACHO-PPC-NEXT: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
+# MACHO-PPC-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Address: 0x64
+# MACHO-PPC-NEXT: Size: 0x4
+# MACHO-PPC-NEXT: Offset: 628
+# MACHO-PPC-NEXT: Alignment: 2
+# MACHO-PPC-NEXT: RelocationOffset: 0x0
+# MACHO-PPC-NEXT: RelocationCount: 0
+# MACHO-PPC-NEXT: Type: NonLazySymbolPointers (0x6)
+# MACHO-PPC-NEXT: Attributes [ (0x0)
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Reserved1: 0x1
+# MACHO-PPC-NEXT: Reserved2: 0x0
+# MACHO-PPC-NEXT: Relocations [
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Symbols [
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: SectionData (
+# MACHO-PPC-NEXT: 0000: 00000000 |....|
+# MACHO-PPC-NEXT: )
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Section {
+# MACHO-PPC-NEXT: Index: 4
+# MACHO-PPC-NEXT: Name: __la_symbol_ptr (5F 5F 6C 61 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
+# MACHO-PPC-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Address: 0x68
+# MACHO-PPC-NEXT: Size: 0x4
+# MACHO-PPC-NEXT: Offset: 632
+# MACHO-PPC-NEXT: Alignment: 2
+# MACHO-PPC-NEXT: RelocationOffset: 0x2C4
+# MACHO-PPC-NEXT: RelocationCount: 1
+# MACHO-PPC-NEXT: Type: LazySymbolPointers (0x7)
+# MACHO-PPC-NEXT: Attributes [ (0x0)
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Reserved1: 0x2
+# MACHO-PPC-NEXT: Reserved2: 0x0
+# MACHO-PPC-NEXT: Relocations [
+# MACHO-PPC-NEXT: Relocation {
+# MACHO-PPC-NEXT: Offset: 0x0
+# MACHO-PPC-NEXT: PCRel: 0
+# MACHO-PPC-NEXT: Length: 2
+# MACHO-PPC-NEXT: Type: PPC_RELOC_VANILLA (0)
+# MACHO-PPC-NEXT: Symbol: dyld_stub_binding_helper (5)
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Symbols [
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: SectionData (
+# MACHO-PPC-NEXT: 0000: 00000000 |....|
+# MACHO-PPC-NEXT: )
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: ]
+
+# MACHO-PPC64: Sections [
+# MACHO-PPC64-NEXT: Section {
+# MACHO-PPC64-NEXT: Index: 0
+# MACHO-PPC64-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Address: 0x0
+# MACHO-PPC64-NEXT: Size: 0x3C
+# MACHO-PPC64-NEXT: Offset: 608
+# MACHO-PPC64-NEXT: Alignment: 2
+# MACHO-PPC64-NEXT: RelocationOffset: 0x2D4
+# MACHO-PPC64-NEXT: RelocationCount: 5
+# MACHO-PPC64-NEXT: Type: Regular (0x0)
+# MACHO-PPC64-NEXT: Attributes [ (0x800004)
+# MACHO-PPC64-NEXT: PureInstructions (0x800000)
+# MACHO-PPC64-NEXT: SomeInstructions (0x4)
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Reserved1: 0x0
+# MACHO-PPC64-NEXT: Reserved2: 0x0
+# MACHO-PPC64-NEXT: Reserved3: 0x0
+# MACHO-PPC64-NEXT: Relocations [
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x24
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (14)
+# MACHO-PPC64-NEXT: Value: 0x64
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x0
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (1)
+# MACHO-PPC64-NEXT: Value: 0xC
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x1C
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (12)
+# MACHO-PPC64-NEXT: Value: 0x64
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x58
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (1)
+# MACHO-PPC64-NEXT: Value: 0xC
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x18
+# MACHO-PPC64-NEXT: PCRel: 1
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (3)
+# MACHO-PPC64-NEXT: Section: __picsymbolstub1 (2)
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Symbols [
+# MACHO-PPC64-NEXT: Symbol {
+# MACHO-PPC64-NEXT: Name: _f (4)
+# MACHO-PPC64-NEXT: Extern
+# MACHO-PPC64-NEXT: Type: Section (0xE)
+# MACHO-PPC64-NEXT: Section: __text (0x1)
+# MACHO-PPC64-NEXT: RefType: UndefinedNonLazy (0x0)
+# MACHO-PPC64-NEXT: Flags [ (0x0)
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Value: 0x0
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: SectionData (
+# MACHO-PPC64-NEXT: 0000: 7C0802A6 FBE1FFF8 429F0005 7FE802A6 ||.......B.......|
+# MACHO-PPC64-NEXT: 0010: F8010010 F821FF81 48000029 3C5F0000 |.....!..H..)<_..|
+# MACHO-PPC64-NEXT: 0020: 38210080 E8420058 E8010010 EBE1FFF8 |8!...B.X........|
+# MACHO-PPC64-NEXT: 0030: 7C0803A6 E8620002 4E800020 ||....b..N.. |
+# MACHO-PPC64-NEXT: )
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Section {
+# MACHO-PPC64-NEXT: Index: 1
+# MACHO-PPC64-NEXT: Name: __picsymbolstub1 (5F 5F 70 69 63 73 79 6D 62 6F 6C 73 74 75 62 31)
+# MACHO-PPC64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Address: 0x40
+# MACHO-PPC64-NEXT: Size: 0x20
+# MACHO-PPC64-NEXT: Offset: 672
+# MACHO-PPC64-NEXT: Alignment: 5
+# MACHO-PPC64-NEXT: RelocationOffset: 0x2FC
+# MACHO-PPC64-NEXT: RelocationCount: 4
+# MACHO-PPC64-NEXT: Type: SymbolStubs (0x8)
+# MACHO-PPC64-NEXT: Attributes [ (0x800004)
+# MACHO-PPC64-NEXT: PureInstructions (0x800000)
+# MACHO-PPC64-NEXT: SomeInstructions (0x4)
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Reserved1: 0x0
+# MACHO-PPC64-NEXT: Reserved2: 0x20
+# MACHO-PPC64-NEXT: Reserved3: 0x0
+# MACHO-PPC64-NEXT: Relocations [
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x14
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (14)
+# MACHO-PPC64-NEXT: Value: 0x6C
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x0
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (1)
+# MACHO-PPC64-NEXT: Value: 0x48
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0xC
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (12)
+# MACHO-PPC64-NEXT: Value: 0x6C
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x24
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 2
+# MACHO-PPC64-NEXT: Type: (1)
+# MACHO-PPC64-NEXT: Value: 0x48
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Symbols [
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: SectionData (
+# MACHO-PPC64-NEXT: 0000: 7C0802A6 429F0005 7D6802A6 3D6B0000 ||...B...}h..=k..|
+# MACHO-PPC64-NEXT: 0010: 7C0803A6 E98B0025 7D8903A6 4E800420 ||......%}...N.. |
+# MACHO-PPC64-NEXT: )
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Section {
+# MACHO-PPC64-NEXT: Index: 2
+# MACHO-PPC64-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Address: 0x60
+# MACHO-PPC64-NEXT: Size: 0x4
+# MACHO-PPC64-NEXT: Offset: 704
+# MACHO-PPC64-NEXT: Alignment: 2
+# MACHO-PPC64-NEXT: RelocationOffset: 0x0
+# MACHO-PPC64-NEXT: RelocationCount: 0
+# MACHO-PPC64-NEXT: Type: Regular (0x0)
+# MACHO-PPC64-NEXT: Attributes [ (0x0)
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Reserved1: 0x0
+# MACHO-PPC64-NEXT: Reserved2: 0x0
+# MACHO-PPC64-NEXT: Reserved3: 0x0
+# MACHO-PPC64-NEXT: Relocations [
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Symbols [
+# MACHO-PPC64-NEXT: Symbol {
+# MACHO-PPC64-NEXT: Name: _b (1)
+# MACHO-PPC64-NEXT: Extern
+# MACHO-PPC64-NEXT: Type: Section (0xE)
+# MACHO-PPC64-NEXT: Section: __data (0x3)
+# MACHO-PPC64-NEXT: RefType: UndefinedNonLazy (0x0)
+# MACHO-PPC64-NEXT: Flags [ (0x0)
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Value: 0x60
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: SectionData (
+# MACHO-PPC64-NEXT: 0000: 0000002A |...*|
+# MACHO-PPC64-NEXT: )
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Section {
+# MACHO-PPC64-NEXT: Index: 3
+# MACHO-PPC64-NEXT: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
+# MACHO-PPC64-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Address: 0x64
+# MACHO-PPC64-NEXT: Size: 0x8
+# MACHO-PPC64-NEXT: Offset: 708
+# MACHO-PPC64-NEXT: Alignment: 2
+# MACHO-PPC64-NEXT: RelocationOffset: 0x0
+# MACHO-PPC64-NEXT: RelocationCount: 0
+# MACHO-PPC64-NEXT: Type: NonLazySymbolPointers (0x6)
+# MACHO-PPC64-NEXT: Attributes [ (0x0)
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Reserved1: 0x1
+# MACHO-PPC64-NEXT: Reserved2: 0x0
+# MACHO-PPC64-NEXT: Reserved3: 0x0
+# MACHO-PPC64-NEXT: Relocations [
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Symbols [
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: SectionData (
+# MACHO-PPC64-NEXT: 0000: 00000000 00000000 |........|
+# MACHO-PPC64-NEXT: )
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Section {
+# MACHO-PPC64-NEXT: Index: 4
+# MACHO-PPC64-NEXT: Name: __la_symbol_ptr (5F 5F 6C 61 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
+# MACHO-PPC64-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Address: 0x6C
+# MACHO-PPC64-NEXT: Size: 0x8
+# MACHO-PPC64-NEXT: Offset: 716
+# MACHO-PPC64-NEXT: Alignment: 2
+# MACHO-PPC64-NEXT: RelocationOffset: 0x31C
+# MACHO-PPC64-NEXT: RelocationCount: 1
+# MACHO-PPC64-NEXT: Type: LazySymbolPointers (0x7)
+# MACHO-PPC64-NEXT: Attributes [ (0x0)
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Reserved1: 0x2
+# MACHO-PPC64-NEXT: Reserved2: 0x0
+# MACHO-PPC64-NEXT: Reserved3: 0x0
+# MACHO-PPC64-NEXT: Relocations [
+# MACHO-PPC64-NEXT: Relocation {
+# MACHO-PPC64-NEXT: Offset: 0x0
+# MACHO-PPC64-NEXT: PCRel: 0
+# MACHO-PPC64-NEXT: Length: 3
+# MACHO-PPC64-NEXT: Type: (0)
+# MACHO-PPC64-NEXT: Symbol: dyld_stub_binding_helper (5)
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Symbols [
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: SectionData (
+# MACHO-PPC64-NEXT: 0000: 00000000 00000000 |........|
+# MACHO-PPC64-NEXT: )
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: ]
+
+# MACHO-ARM: Sections [
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 0
+# MACHO-ARM-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x0
+# MACHO-ARM-NEXT: Size: 0x3C
+# MACHO-ARM-NEXT: Offset: 664
+# MACHO-ARM-NEXT: Alignment: 2
+# MACHO-ARM-NEXT: RelocationOffset: 0x2E0
+# MACHO-ARM-NEXT: RelocationCount: 9
+# MACHO-ARM-NEXT: Type: Regular (0x0)
+# MACHO-ARM-NEXT: Attributes [ (0x800004)
+# MACHO-ARM-NEXT: PureInstructions (0x800000)
+# MACHO-ARM-NEXT: SomeInstructions (0x4)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x0
+# MACHO-ARM-NEXT: Relocations [
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x38
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 2
+# MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
+# MACHO-ARM-NEXT: Value: 0x40
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x0
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 2
+# MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+# MACHO-ARM-NEXT: Value: 0x28
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x20
+# MACHO-ARM-NEXT: PCRel: 1
+# MACHO-ARM-NEXT: Length: 2
+# MACHO-ARM-NEXT: Type: ARM_RELOC_BR24 (5)
+# MACHO-ARM-NEXT: Symbol: _g
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x1C
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 1
+# MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
+# MACHO-ARM-NEXT: Symbol: _g
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x0
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 1
+# MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+# MACHO-ARM-NEXT: Section: -
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x18
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 0
+# MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
+# MACHO-ARM-NEXT: Symbol: _g
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x0
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 0
+# MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+# MACHO-ARM-NEXT: Section: -
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0xC
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 2
+# MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
+# MACHO-ARM-NEXT: Value: 0x44
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Relocation {
+# MACHO-ARM-NEXT: Offset: 0x0
+# MACHO-ARM-NEXT: PCRel: 0
+# MACHO-ARM-NEXT: Length: 2
+# MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+# MACHO-ARM-NEXT: Value: 0x4
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Symbols [
+# MACHO-ARM-NEXT: Symbol {
+# MACHO-ARM-NEXT: Name: _f (4)
+# MACHO-ARM-NEXT: Extern
+# MACHO-ARM-NEXT: Type: Section (0xE)
+# MACHO-ARM-NEXT: Section: __text (0x1)
+# MACHO-ARM-NEXT: RefType: UndefinedNonLazy (0x0)
+# MACHO-ARM-NEXT: Flags [ (0x0)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Value: 0x10
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Symbol {
+# MACHO-ARM-NEXT: Name: _h (1)
+# MACHO-ARM-NEXT: Extern
+# MACHO-ARM-NEXT: Type: Section (0xE)
+# MACHO-ARM-NEXT: Section: __text (0x1)
+# MACHO-ARM-NEXT: RefType: UndefinedNonLazy (0x0)
+# MACHO-ARM-NEXT: Flags [ (0x0)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Value: 0x0
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: SectionData (
+# MACHO-ARM-NEXT: 0000: 04009FE5 00009FE7 1EFF2FE1 38000000 |........../.8...|
+# MACHO-ARM-NEXT: 0010: 80402DE9 0D70A0E1 000000E3 000040E3 |. at -..p........@.|
+# MACHO-ARM-NEXT: 0020: F6FFFFEB 0C009FE5 00009FE7 000090E5 |................|
+# MACHO-ARM-NEXT: 0030: 8040BDE8 1EFF2FE1 10000000 |. at ..../.....|
+# MACHO-ARM-NEXT: )
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 1
+# MACHO-ARM-NEXT: Name: __textcoal_nt (5F 5F 74 65 78 74 63 6F 61 6C 5F 6E 74 00 00 00)
+# MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x3C
+# MACHO-ARM-NEXT: Size: 0x0
+# MACHO-ARM-NEXT: Offset: 724
+# MACHO-ARM-NEXT: Alignment: 0
+# MACHO-ARM-NEXT: RelocationOffset: 0x0
+# MACHO-ARM-NEXT: RelocationCount: 0
+# MACHO-ARM-NEXT: Type: Coalesced (0xB)
+# MACHO-ARM-NEXT: Attributes [ (0x800000)
+# MACHO-ARM-NEXT: PureInstructions (0x800000)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x0
+# MACHO-ARM-NEXT: Relocations [
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Symbols [
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: SectionData (
+# MACHO-ARM-NEXT: )
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 2
+# MACHO-ARM-NEXT: Name: __const_coal (5F 5F 63 6F 6E 73 74 5F 63 6F 61 6C 00 00 00 00)
+# MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x3C
+# MACHO-ARM-NEXT: Size: 0x0
+# MACHO-ARM-NEXT: Offset: 724
+# MACHO-ARM-NEXT: Alignment: 0
+# MACHO-ARM-NEXT: RelocationOffset: 0x0
+# MACHO-ARM-NEXT: RelocationCount: 0
+# MACHO-ARM-NEXT: Type: Coalesced (0xB)
+# MACHO-ARM-NEXT: Attributes [ (0x0)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x0
+# MACHO-ARM-NEXT: Relocations [
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Symbols [
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: SectionData (
+# MACHO-ARM-NEXT: )
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 3
+# MACHO-ARM-NEXT: Name: __picsymbolstub4 (5F 5F 70 69 63 73 79 6D 62 6F 6C 73 74 75 62 34)
+# MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x3C
+# MACHO-ARM-NEXT: Size: 0x0
+# MACHO-ARM-NEXT: Offset: 724
+# MACHO-ARM-NEXT: Alignment: 0
+# MACHO-ARM-NEXT: RelocationOffset: 0x0
+# MACHO-ARM-NEXT: RelocationCount: 0
+# MACHO-ARM-NEXT: Type: SymbolStubs (0x8)
+# MACHO-ARM-NEXT: Attributes [ (0x0)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x10
+# MACHO-ARM-NEXT: Relocations [
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Symbols [
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: SectionData (
+# MACHO-ARM-NEXT: )
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 4
+# MACHO-ARM-NEXT: Name: __StaticInit (5F 5F 53 74 61 74 69 63 49 6E 69 74 00 00 00 00)
+# MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x3C
+# MACHO-ARM-NEXT: Size: 0x0
+# MACHO-ARM-NEXT: Offset: 724
+# MACHO-ARM-NEXT: Alignment: 0
+# MACHO-ARM-NEXT: RelocationOffset: 0x0
+# MACHO-ARM-NEXT: RelocationCount: 0
+# MACHO-ARM-NEXT: Type: Regular (0x0)
+# MACHO-ARM-NEXT: Attributes [ (0x800000)
+# MACHO-ARM-NEXT: PureInstructions (0x800000)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x0
+# MACHO-ARM-NEXT: Relocations [
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Symbols [
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: SectionData (
+# MACHO-ARM-NEXT: )
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 5
+# MACHO-ARM-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x3C
+# MACHO-ARM-NEXT: Size: 0x4
+# MACHO-ARM-NEXT: Offset: 724
+# MACHO-ARM-NEXT: Alignment: 2
+# MACHO-ARM-NEXT: RelocationOffset: 0x0
+# MACHO-ARM-NEXT: RelocationCount: 0
+# MACHO-ARM-NEXT: Type: Regular (0x0)
+# MACHO-ARM-NEXT: Attributes [ (0x0)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x0
+# MACHO-ARM-NEXT: Relocations [
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Symbols [
+# MACHO-ARM-NEXT: Symbol {
+# MACHO-ARM-NEXT: Name: _b (10)
+# MACHO-ARM-NEXT: Extern
+# MACHO-ARM-NEXT: Type: Section (0xE)
+# MACHO-ARM-NEXT: Section: __data (0x6)
+# MACHO-ARM-NEXT: RefType: UndefinedNonLazy (0x0)
+# MACHO-ARM-NEXT: Flags [ (0x0)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Value: 0x3C
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: SectionData (
+# MACHO-ARM-NEXT: 0000: 2A000000 |*...|
+# MACHO-ARM-NEXT: )
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 6
+# MACHO-ARM-NEXT: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
+# MACHO-ARM-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x40
+# MACHO-ARM-NEXT: Size: 0x8
+# MACHO-ARM-NEXT: Offset: 728
+# MACHO-ARM-NEXT: Alignment: 2
+# MACHO-ARM-NEXT: RelocationOffset: 0x0
+# MACHO-ARM-NEXT: RelocationCount: 0
+# MACHO-ARM-NEXT: Type: NonLazySymbolPointers (0x6)
+# MACHO-ARM-NEXT: Attributes [ (0x0)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x0
+# MACHO-ARM-NEXT: Relocations [
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Symbols [
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: SectionData (
+# MACHO-ARM-NEXT: 0000: 00000000 00000000 |........|
+# MACHO-ARM-NEXT: )
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/MachO/sections.test b/llvm/test/tools/llvm-readobj/MachO/sections.test
index 37c6567164b6..1d2ab068f50b 100644
--- a/llvm/test/tools/llvm-readobj/MachO/sections.test
+++ b/llvm/test/tools/llvm-readobj/MachO/sections.test
@@ -1,6 +1,8 @@
+## Check how we print sections.
+
## Show that llvm-readobj prints MachO all section types properly.
-# RUN: yaml2obj %s > %t
-# RUN: llvm-readobj --sections %t | FileCheck %s
+# RUN: yaml2obj --docnum=1 %s > %t1
+# RUN: llvm-readobj --sections %t1 | FileCheck %s
# CHECK: Type: Regular (0x0)
# CHECK: Type: ZeroFill (0x1)
@@ -312,3 +314,389 @@ LoadCommands:
reserved1: 0x00000000
reserved2: 0x00000000
reserved3: 0x00000000
+
+## Check that we can print sections for other targets.
+
+# RUN: llvm-readobj --sections %p/Inputs/trivial.obj.macho-i386 \
+# RUN: | FileCheck %s --check-prefix MACHO-I386
+# RUN: llvm-readobj --sections %p/Inputs/trivial.obj.macho-x86-64 \
+# RUN: | FileCheck %s --check-prefix MACHO-X86-64
+# RUN: llvm-readobj --sections %p/Inputs/trivial.obj.macho-ppc \
+# RUN: | FileCheck %s --check-prefix MACHO-PPC
+# RUN: llvm-readobj --sections %p/Inputs/trivial.obj.macho-ppc64 \
+# RUN: | FileCheck %s --check-prefix MACHO-PPC64
+# RUN: llvm-readobj --sections %p/Inputs/trivial.obj.macho-arm \
+# RUN: | FileCheck %s --check-prefix MACHO-ARM
+
+# MACHO-I386: Sections [
+# MACHO-I386-NEXT: Section {
+# MACHO-I386-NEXT: Index: 0
+# MACHO-I386-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+# MACHO-I386-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-I386-NEXT: Address: 0x0
+# MACHO-I386-NEXT: Size: 0x22
+# MACHO-I386-NEXT: Offset: 324
+# MACHO-I386-NEXT: Alignment: 4
+# MACHO-I386-NEXT: RelocationOffset: 0x174
+# MACHO-I386-NEXT: RelocationCount: 4
+# MACHO-I386-NEXT: Type: Regular (0x0)
+# MACHO-I386-NEXT: Attributes [ (0x800004)
+# MACHO-I386-NEXT: PureInstructions (0x800000)
+# MACHO-I386-NEXT: SomeInstructions (0x4)
+# MACHO-I386-NEXT: ]
+# MACHO-I386-NEXT: Reserved1: 0x0
+# MACHO-I386-NEXT: Reserved2: 0x0
+# MACHO-I386-NEXT: }
+# MACHO-I386-NEXT: Section {
+# MACHO-I386-NEXT: Index: 1
+# MACHO-I386-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
+# MACHO-I386-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-I386-NEXT: Address: 0x22
+# MACHO-I386-NEXT: Size: 0xD
+# MACHO-I386-NEXT: Offset: 358
+# MACHO-I386-NEXT: Alignment: 0
+# MACHO-I386-NEXT: RelocationOffset: 0x0
+# MACHO-I386-NEXT: RelocationCount: 0
+# MACHO-I386-NEXT: Type: CStringLiterals (0x2)
+# MACHO-I386-NEXT: Attributes [ (0x0)
+# MACHO-I386-NEXT: ]
+# MACHO-I386-NEXT: Reserved1: 0x0
+# MACHO-I386-NEXT: Reserved2: 0x0
+# MACHO-I386-NEXT: }
+
+# MACHO-X86-64: Sections [
+# MACHO-X86-64-NEXT: Section {
+# MACHO-X86-64-NEXT: Index: 0
+# MACHO-X86-64-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+# MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-X86-64-NEXT: Address: 0x0
+# MACHO-X86-64-NEXT: Size: 0x16
+# MACHO-X86-64-NEXT: Offset: 368
+# MACHO-X86-64-NEXT: Alignment: 4
+# MACHO-X86-64-NEXT: RelocationOffset: 0x194
+# MACHO-X86-64-NEXT: RelocationCount: 3
+# MACHO-X86-64-NEXT: Type: Regular (0x0)
+# MACHO-X86-64-NEXT: Attributes [ (0x800004)
+# MACHO-X86-64-NEXT: PureInstructions (0x800000)
+# MACHO-X86-64-NEXT: SomeInstructions (0x4)
+# MACHO-X86-64-NEXT: ]
+# MACHO-X86-64-NEXT: Reserved1: 0x0
+# MACHO-X86-64-NEXT: Reserved2: 0x0
+# MACHO-X86-64-NEXT: Reserved3: 0x0
+# MACHO-X86-64-NEXT: }
+# MACHO-X86-64-NEXT: Section {
+# MACHO-X86-64-NEXT: Index: 1
+# MACHO-X86-64-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
+# MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-X86-64-NEXT: Address: 0x16
+# MACHO-X86-64-NEXT: Size: 0xD
+# MACHO-X86-64-NEXT: Offset: 390
+# MACHO-X86-64-NEXT: Alignment: 0
+# MACHO-X86-64-NEXT: RelocationOffset: 0x0
+# MACHO-X86-64-NEXT: RelocationCount: 0
+# MACHO-X86-64-NEXT: Type: CStringLiterals (0x2)
+# MACHO-X86-64-NEXT: Attributes [ (0x0)
+# MACHO-X86-64-NEXT: ]
+# MACHO-X86-64-NEXT: Reserved1: 0x0
+# MACHO-X86-64-NEXT: Reserved2: 0x0
+# MACHO-X86-64-NEXT: Reserved3: 0x0
+# MACHO-X86-64-NEXT: }
+# MACHO-X86-64-NEXT:]
+
+# MACHO-PPC: Sections [
+# MACHO-PPC-NEXT: Section {
+# MACHO-PPC-NEXT: Index: 0
+# MACHO-PPC-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Address: 0x0
+# MACHO-PPC-NEXT: Size: 0x3C
+# MACHO-PPC-NEXT: Offset: 528
+# MACHO-PPC-NEXT: Alignment: 2
+# MACHO-PPC-NEXT: RelocationOffset: 0x27C
+# MACHO-PPC-NEXT: RelocationCount: 5
+# MACHO-PPC-NEXT: Type: Regular (0x0)
+# MACHO-PPC-NEXT: Attributes [ (0x800004)
+# MACHO-PPC-NEXT: PureInstructions (0x800000)
+# MACHO-PPC-NEXT: SomeInstructions (0x4)
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Reserved1: 0x0
+# MACHO-PPC-NEXT: Reserved2: 0x0
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Section {
+# MACHO-PPC-NEXT: Index: 1
+# MACHO-PPC-NEXT: Name: __picsymbolstub1 (5F 5F 70 69 63 73 79 6D 62 6F 6C 73 74 75 62 31)
+# MACHO-PPC-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Address: 0x40
+# MACHO-PPC-NEXT: Size: 0x20
+# MACHO-PPC-NEXT: Offset: 592
+# MACHO-PPC-NEXT: Alignment: 5
+# MACHO-PPC-NEXT: RelocationOffset: 0x2A4
+# MACHO-PPC-NEXT: RelocationCount: 4
+# MACHO-PPC-NEXT: Type: SymbolStubs (0x8)
+# MACHO-PPC-NEXT: Attributes [ (0x800004)
+# MACHO-PPC-NEXT: PureInstructions (0x800000)
+# MACHO-PPC-NEXT: SomeInstructions (0x4)
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Reserved1: 0x0
+# MACHO-PPC-NEXT: Reserved2: 0x20
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Section {
+# MACHO-PPC-NEXT: Index: 2
+# MACHO-PPC-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Address: 0x60
+# MACHO-PPC-NEXT: Size: 0x4
+# MACHO-PPC-NEXT: Offset: 624
+# MACHO-PPC-NEXT: Alignment: 2
+# MACHO-PPC-NEXT: RelocationOffset: 0x0
+# MACHO-PPC-NEXT: RelocationCount: 0
+# MACHO-PPC-NEXT: Type: Regular (0x0)
+# MACHO-PPC-NEXT: Attributes [ (0x0)
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Reserved1: 0x0
+# MACHO-PPC-NEXT: Reserved2: 0x0
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Section {
+# MACHO-PPC-NEXT: Index: 3
+# MACHO-PPC-NEXT: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
+# MACHO-PPC-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Address: 0x64
+# MACHO-PPC-NEXT: Size: 0x4
+# MACHO-PPC-NEXT: Offset: 628
+# MACHO-PPC-NEXT: Alignment: 2
+# MACHO-PPC-NEXT: RelocationOffset: 0x0
+# MACHO-PPC-NEXT: RelocationCount: 0
+# MACHO-PPC-NEXT: Type: NonLazySymbolPointers (0x6)
+# MACHO-PPC-NEXT: Attributes [ (0x0)
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Reserved1: 0x1
+# MACHO-PPC-NEXT: Reserved2: 0x0
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: Section {
+# MACHO-PPC-NEXT: Index: 4
+# MACHO-PPC-NEXT: Name: __la_symbol_ptr (5F 5F 6C 61 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
+# MACHO-PPC-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC-NEXT: Address: 0x68
+# MACHO-PPC-NEXT: Size: 0x4
+# MACHO-PPC-NEXT: Offset: 632
+# MACHO-PPC-NEXT: Alignment: 2
+# MACHO-PPC-NEXT: RelocationOffset: 0x2C4
+# MACHO-PPC-NEXT: RelocationCount: 1
+# MACHO-PPC-NEXT: Type: LazySymbolPointers (0x7)
+# MACHO-PPC-NEXT: Attributes [ (0x0)
+# MACHO-PPC-NEXT: ]
+# MACHO-PPC-NEXT: Reserved1: 0x2
+# MACHO-PPC-NEXT: Reserved2: 0x0
+# MACHO-PPC-NEXT: }
+# MACHO-PPC-NEXT: ]
+
+# MACHO-PPC64: Sections [
+# MACHO-PPC64-NEXT: Section {
+# MACHO-PPC64-NEXT: Index: 0
+# MACHO-PPC64-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Address: 0x0
+# MACHO-PPC64-NEXT: Size: 0x3C
+# MACHO-PPC64-NEXT: Offset: 608
+# MACHO-PPC64-NEXT: Alignment: 2
+# MACHO-PPC64-NEXT: RelocationOffset: 0x2D4
+# MACHO-PPC64-NEXT: RelocationCount: 5
+# MACHO-PPC64-NEXT: Type: Regular (0x0)
+# MACHO-PPC64-NEXT: Attributes [ (0x800004)
+# MACHO-PPC64-NEXT: PureInstructions (0x800000)
+# MACHO-PPC64-NEXT: SomeInstructions (0x4)
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Reserved1: 0x0
+# MACHO-PPC64-NEXT: Reserved2: 0x0
+# MACHO-PPC64-NEXT: Reserved3: 0x0
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Section {
+# MACHO-PPC64-NEXT: Index: 1
+# MACHO-PPC64-NEXT: Name: __picsymbolstub1 (5F 5F 70 69 63 73 79 6D 62 6F 6C 73 74 75 62 31)
+# MACHO-PPC64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Address: 0x40
+# MACHO-PPC64-NEXT: Size: 0x20
+# MACHO-PPC64-NEXT: Offset: 672
+# MACHO-PPC64-NEXT: Alignment: 5
+# MACHO-PPC64-NEXT: RelocationOffset: 0x2FC
+# MACHO-PPC64-NEXT: RelocationCount: 4
+# MACHO-PPC64-NEXT: Type: SymbolStubs (0x8)
+# MACHO-PPC64-NEXT: Attributes [ (0x800004)
+# MACHO-PPC64-NEXT: PureInstructions (0x800000)
+# MACHO-PPC64-NEXT: SomeInstructions (0x4)
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Reserved1: 0x0
+# MACHO-PPC64-NEXT: Reserved2: 0x20
+# MACHO-PPC64-NEXT: Reserved3: 0x0
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Section {
+# MACHO-PPC64-NEXT: Index: 2
+# MACHO-PPC64-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Address: 0x60
+# MACHO-PPC64-NEXT: Size: 0x4
+# MACHO-PPC64-NEXT: Offset: 704
+# MACHO-PPC64-NEXT: Alignment: 2
+# MACHO-PPC64-NEXT: RelocationOffset: 0x0
+# MACHO-PPC64-NEXT: RelocationCount: 0
+# MACHO-PPC64-NEXT: Type: Regular (0x0)
+# MACHO-PPC64-NEXT: Attributes [ (0x0)
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Reserved1: 0x0
+# MACHO-PPC64-NEXT: Reserved2: 0x0
+# MACHO-PPC64-NEXT: Reserved3: 0x0
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Section {
+# MACHO-PPC64-NEXT: Index: 3
+# MACHO-PPC64-NEXT: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
+# MACHO-PPC64-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Address: 0x64
+# MACHO-PPC64-NEXT: Size: 0x8
+# MACHO-PPC64-NEXT: Offset: 708
+# MACHO-PPC64-NEXT: Alignment: 2
+# MACHO-PPC64-NEXT: RelocationOffset: 0x0
+# MACHO-PPC64-NEXT: RelocationCount: 0
+# MACHO-PPC64-NEXT: Type: NonLazySymbolPointers (0x6)
+# MACHO-PPC64-NEXT: Attributes [ (0x0)
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Reserved1: 0x1
+# MACHO-PPC64-NEXT: Reserved2: 0x0
+# MACHO-PPC64-NEXT: Reserved3: 0x0
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: Section {
+# MACHO-PPC64-NEXT: Index: 4
+# MACHO-PPC64-NEXT: Name: __la_symbol_ptr (5F 5F 6C 61 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
+# MACHO-PPC64-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-PPC64-NEXT: Address: 0x6C
+# MACHO-PPC64-NEXT: Size: 0x8
+# MACHO-PPC64-NEXT: Offset: 716
+# MACHO-PPC64-NEXT: Alignment: 2
+# MACHO-PPC64-NEXT: RelocationOffset: 0x31C
+# MACHO-PPC64-NEXT: RelocationCount: 1
+# MACHO-PPC64-NEXT: Type: LazySymbolPointers (0x7)
+# MACHO-PPC64-NEXT: Attributes [ (0x0)
+# MACHO-PPC64-NEXT: ]
+# MACHO-PPC64-NEXT: Reserved1: 0x2
+# MACHO-PPC64-NEXT: Reserved2: 0x0
+# MACHO-PPC64-NEXT: Reserved3: 0x0
+# MACHO-PPC64-NEXT: }
+# MACHO-PPC64-NEXT: ]
+
+# MACHO-ARM: Sections [
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 0
+# MACHO-ARM-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x0
+# MACHO-ARM-NEXT: Size: 0x3C
+# MACHO-ARM-NEXT: Offset: 664
+# MACHO-ARM-NEXT: Alignment: 2
+# MACHO-ARM-NEXT: RelocationOffset: 0x2E0
+# MACHO-ARM-NEXT: RelocationCount: 9
+# MACHO-ARM-NEXT: Type: Regular (0x0)
+# MACHO-ARM-NEXT: Attributes [ (0x800004)
+# MACHO-ARM-NEXT: PureInstructions (0x800000)
+# MACHO-ARM-NEXT: SomeInstructions (0x4)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x0
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 1
+# MACHO-ARM-NEXT: Name: __textcoal_nt (5F 5F 74 65 78 74 63 6F 61 6C 5F 6E 74 00 00 00)
+# MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x3C
+# MACHO-ARM-NEXT: Size: 0x0
+# MACHO-ARM-NEXT: Offset: 724
+# MACHO-ARM-NEXT: Alignment: 0
+# MACHO-ARM-NEXT: RelocationOffset: 0x0
+# MACHO-ARM-NEXT: RelocationCount: 0
+# MACHO-ARM-NEXT: Type: Coalesced (0xB)
+# MACHO-ARM-NEXT: Attributes [ (0x800000)
+# MACHO-ARM-NEXT: PureInstructions (0x800000)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x0
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 2
+# MACHO-ARM-NEXT: Name: __const_coal (5F 5F 63 6F 6E 73 74 5F 63 6F 61 6C 00 00 00 00)
+# MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x3C
+# MACHO-ARM-NEXT: Size: 0x0
+# MACHO-ARM-NEXT: Offset: 724
+# MACHO-ARM-NEXT: Alignment: 0
+# MACHO-ARM-NEXT: RelocationOffset: 0x0
+# MACHO-ARM-NEXT: RelocationCount: 0
+# MACHO-ARM-NEXT: Type: Coalesced (0xB)
+# MACHO-ARM-NEXT: Attributes [ (0x0)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x0
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 3
+# MACHO-ARM-NEXT: Name: __picsymbolstub4 (5F 5F 70 69 63 73 79 6D 62 6F 6C 73 74 75 62 34)
+# MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x3C
+# MACHO-ARM-NEXT: Size: 0x0
+# MACHO-ARM-NEXT: Offset: 724
+# MACHO-ARM-NEXT: Alignment: 0
+# MACHO-ARM-NEXT: RelocationOffset: 0x0
+# MACHO-ARM-NEXT: RelocationCount: 0
+# MACHO-ARM-NEXT: Type: SymbolStubs (0x8)
+# MACHO-ARM-NEXT: Attributes [ (0x0)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x10
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 4
+# MACHO-ARM-NEXT: Name: __StaticInit (5F 5F 53 74 61 74 69 63 49 6E 69 74 00 00 00 00)
+# MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x3C
+# MACHO-ARM-NEXT: Size: 0x0
+# MACHO-ARM-NEXT: Offset: 724
+# MACHO-ARM-NEXT: Alignment: 0
+# MACHO-ARM-NEXT: RelocationOffset: 0x0
+# MACHO-ARM-NEXT: RelocationCount: 0
+# MACHO-ARM-NEXT: Type: Regular (0x0)
+# MACHO-ARM-NEXT: Attributes [ (0x800000)
+# MACHO-ARM-NEXT: PureInstructions (0x800000)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x0
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 5
+# MACHO-ARM-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x3C
+# MACHO-ARM-NEXT: Size: 0x4
+# MACHO-ARM-NEXT: Offset: 724
+# MACHO-ARM-NEXT: Alignment: 2
+# MACHO-ARM-NEXT: RelocationOffset: 0x0
+# MACHO-ARM-NEXT: RelocationCount: 0
+# MACHO-ARM-NEXT: Type: Regular (0x0)
+# MACHO-ARM-NEXT: Attributes [ (0x0)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x0
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: Section {
+# MACHO-ARM-NEXT: Index: 6
+# MACHO-ARM-NEXT: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
+# MACHO-ARM-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
+# MACHO-ARM-NEXT: Address: 0x40
+# MACHO-ARM-NEXT: Size: 0x8
+# MACHO-ARM-NEXT: Offset: 728
+# MACHO-ARM-NEXT: Alignment: 2
+# MACHO-ARM-NEXT: RelocationOffset: 0x0
+# MACHO-ARM-NEXT: RelocationCount: 0
+# MACHO-ARM-NEXT: Type: NonLazySymbolPointers (0x6)
+# MACHO-ARM-NEXT: Attributes [ (0x0)
+# MACHO-ARM-NEXT: ]
+# MACHO-ARM-NEXT: Reserved1: 0x0
+# MACHO-ARM-NEXT: Reserved2: 0x0
+# MACHO-ARM-NEXT: }
+# MACHO-ARM-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/archive.test b/llvm/test/tools/llvm-readobj/archive.test
index f6a27a212283..a06a917a5875 100644
--- a/llvm/test/tools/llvm-readobj/archive.test
+++ b/llvm/test/tools/llvm-readobj/archive.test
@@ -1,7 +1,13 @@
-# Show that dumping operations apply to all members in an archive.
+## Show that dumping operations apply to all members in an archive.
# RUN: rm -f %t.a
-# RUN: llvm-ar rc %t.a %p/ELF/Inputs/trivial.obj.elf-x86-64 %p/ELF/Inputs/trivial.obj.elf-i386 %p/COFF/Inputs/trivial.obj.coff-arm
+# RUN: rm -rf %t.dir
+# RUN: mkdir -p %t.dir
+# RUN: yaml2obj --docnum=1 %s -o %t.dir/trivial.obj.elf-x86-64
+# RUN: yaml2obj --docnum=2 %s -o %t.dir/trivial.obj.elf-i386
+# RUN: yaml2obj --docnum=3 %s -o %t.dir/trivial.obj.coff-arm
+
+# RUN: llvm-ar rc %t.a %t.dir/trivial.obj.elf-x86-64 %t.dir/trivial.obj.elf-i386 %t.dir/trivial.obj.coff-arm
# RUN: llvm-readobj --all %t.a | FileCheck %s -DARFILE="%t.a" --check-prefixes=HEADER,LLVM,COFF
# RUN: llvm-readelf --all %t.a | FileCheck %s -DARFILE="%t.a" --check-prefixes=HEADER,GNU,COFF
@@ -23,8 +29,6 @@
# GNU: ELF Header:
# GNU: Machine: Advanced Micro Devices X86-64
# GNU: Section Headers:
-# GNU: Relocation section '.rela.text'
-# GNU: Symbol table '.symtab'
# GNU: There are no section groups in this file.
# LLVM-EMPTY:
@@ -45,8 +49,6 @@
# GNU: ELF Header:
# GNU: Machine: Intel 80386
# GNU: Section Headers:
-# GNU: Relocation section '.rel.text'
-# GNU: Symbol table '.symtab'
# GNU: There are no section groups in this file.
# LLVM-EMPTY:
@@ -59,3 +61,24 @@
# COFF: Sections [
# COFF: Relocations [
# COFF: Symbols [
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_386
+
+--- !COFF
+header:
+ Machine: IMAGE_FILE_MACHINE_ARMNT
+ Characteristics: [ ]
+sections: []
+symbols: []
diff --git a/llvm/test/tools/llvm-readobj/basic.test b/llvm/test/tools/llvm-readobj/basic.test
index 3f33ff6ab8a1..89962c3231be 100644
--- a/llvm/test/tools/llvm-readobj/basic.test
+++ b/llvm/test/tools/llvm-readobj/basic.test
@@ -1,6 +1,8 @@
-# Test case where input file does not exit.
-RUN: not llvm-readobj %t.blah 2>&1 | FileCheck --check-prefix=ENOENT %s
-ENOENT: '{{.*}}.blah': {{[Nn]}}o such file or directory
+## Test case where input file does not exit.
+RUN: not llvm-readobj %t.blah 2>&1 | FileCheck --check-prefix=ENOENT -DTOOL=readobj %s
+RUN: not llvm-readelf %t.blah 2>&1 | FileCheck --check-prefix=ENOENT -DTOOL=readelf %s
+
+ENOENT: llvm-[[TOOL]]{{(\.exe)?}}: error: '{{.*}}.blah': {{[Nn]}}o such file or directory
# Test case where input file is too small to be a recognised object file.
RUN: touch %t.empty
@@ -13,14 +15,6 @@ RUN: llvm-ar rc %t.a %t.empty
RUN: llvm-readobj --all %t.a 2>&1 | FileCheck --check-prefix=NO-OUTPUT --allow-empty %s
NO-OUTPUT-NOT: {{.}}
-# Test case where no switches are specified.
-RUN: llvm-readobj %p/ELF/Inputs/trivial.obj.elf-x86-64 | FileCheck --check-prefix=HEADER %s
-RUN: llvm-readelf %p/ELF/Inputs/trivial.obj.elf-x86-64 | FileCheck --check-prefix=NO-OUTPUT --allow-empty %s
-HEADER: File: {{.*}}trivial.obj.elf-x86-64
-HEADER: Format: ELF64-x86-64
-HEADER: Arch: x86_64
-HEADER: AddressSize: 64bit
-
# Test case where switch it not recognised.
RUN: not llvm-readobj --unknown-switch 2>&1 | FileCheck --check-prefix=UNKNOWN %s
UNKNOWN: Unknown command line argument '--unknown-switch'
diff --git a/llvm/test/tools/llvm-readobj/error-format.test b/llvm/test/tools/llvm-readobj/error-format.test
deleted file mode 100644
index e0ead99aee27..000000000000
--- a/llvm/test/tools/llvm-readobj/error-format.test
+++ /dev/null
@@ -1,19 +0,0 @@
-## This test shows that we include the tool name in error/warning messages.
-
-# RUN: not llvm-readelf %S/non-existent 2>&1 | FileCheck --check-prefix=ERR %s -DTOOL=readelf
-# RUN: not llvm-readobj %S/non-existent 2>&1 | FileCheck --check-prefix=ERR %s -DTOOL=readobj
-
-# ERR: llvm-[[TOOL]]{{(\.exe)?}}: error: '{{.*}}': {{[Nn]}}o such file or directory
-
-# RUN: yaml2obj %s -o %t
-# RUN: llvm-readelf -x 10 %t 2>&1 | FileCheck --check-prefix=WARN %s -DTOOL=readelf
-# RUN: llvm-readobj -x 10 %t 2>&1 | FileCheck --check-prefix=WARN %s -DTOOL=readobj
-
-# WARN: llvm-[[TOOL]]{{(\.exe)?}}: warning: '{{.*}}': could not find section 10
-
---- !ELF
-FileHeader:
- Class: ELFCLASS64
- Data: ELFDATA2LSB
- Type: ET_DYN
- Machine: EM_RISCV
diff --git a/llvm/test/tools/llvm-readobj/hex-dump.test b/llvm/test/tools/llvm-readobj/hex-dump.test
deleted file mode 100644
index 5e69e0701040..000000000000
--- a/llvm/test/tools/llvm-readobj/hex-dump.test
+++ /dev/null
@@ -1,59 +0,0 @@
-## Test that the -x alias can be used flexibly. Create a baseline and ensure
-## all other combinations are identical.
-# RUN: llvm-readelf --file-header --hex-dump=.text \
-# RUN: %p/ELF/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.out
-# RUN: llvm-readelf -h --hex-dump .text %p/ELF/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.1
-# RUN: llvm-readelf -h -x .text %p/ELF/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.2
-# RUN: llvm-readelf -h -x=.text %p/ELF/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.3
-# RUN: llvm-readelf -h -x.text %p/ELF/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.4
-# RUN: llvm-readelf -hx .text %p/ELF/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.5
-# RUN: llvm-readelf -hx=.text %p/ELF/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.6
-# RUN: llvm-readelf -hx.text %p/ELF/Inputs/trivial.obj.elf-x86-64 > %t.hexdump.7
-
-# RUN: cmp %t.hexdump.out %t.hexdump.1
-# RUN: cmp %t.hexdump.out %t.hexdump.2
-# RUN: cmp %t.hexdump.out %t.hexdump.3
-# RUN: cmp %t.hexdump.out %t.hexdump.4
-# RUN: cmp %t.hexdump.out %t.hexdump.5
-# RUN: cmp %t.hexdump.out %t.hexdump.6
-# RUN: cmp %t.hexdump.out %t.hexdump.7
-
-# RUN: llvm-readelf -S %p/ELF/Inputs/trivial.obj.elf-x86-64 | FileCheck %s --check-prefix=ELF-SEC
-
-## Both 9 and .strtab refer to .strtab. Test we dump the section only once.
-# RUN: llvm-readobj -x 9 -x 9 -x .strtab -x .strtab %p/ELF/Inputs/trivial.obj.elf-x86-64 2>&1 | \
-# RUN: FileCheck %s --check-prefix=ELF
-# RUN: llvm-readobj -x 9 -x .strtab -x 10 -x not_exist \
-# RUN: %p/ELF/Inputs/trivial.obj.elf-x86-64 2>&1 | FileCheck %s -DFILE=%p/ELF/Inputs/trivial.obj.elf-x86-64 --check-prefixes=ELF-WARN,ELF
-
-# ELF-SEC: [ 9] .strtab
-
-# ELF-WARN: warning: '[[FILE]]': could not find section 'not_exist'
-# ELF-WARN: warning: '[[FILE]]': could not find section 10
-# ELF: Hex dump of section '.strtab':
-# ELF-NEXT: 0x00000000 00747269 7669616c 2e6c6c00 6d61696e .trivial.ll.main
-# ELF-NEXT: 0x00000010 002e4c2e 73747200 70757473 00536f6d ..L.str.puts.Som
-# ELF-NEXT: 0x00000020 654f7468 65724675 6e637469 6f6e005f eOtherFunction._
-# ELF-NEXT: 0x00000030 474c4f42 414c5f4f 46465345 545f5441 GLOBAL_OFFSET_TA
-# ELF-NEXT: 0x00000040 424c455f 00 BLE_.
-# ELF-NOT: {{.}}
-
-## Below we test -x can be used for other binary formats.
-
-# RUN: llvm-readobj -x 1 %p/COFF/Inputs/trivial.obj.coff-x86-64 \
-# RUN: | FileCheck %s --check-prefix COFF
-
-# COFF: 0x00000000 4883ec28 488d0d00 000000e8 00000000 H..(H...........
-# COFF: 0x00000010 e8000000 0031c048 83c428c3 .....1.H..(.
-
-# RUN: llvm-readobj -x 1 %p/MachO/Inputs/trivial.obj.macho-x86-64 \
-# RUN: | FileCheck %s --check-prefix MACHO
-
-# MACHO: 0x00000000 50488d3d 00000000 e8000000 00e80000 PH.=............
-# MACHO: 0x00000010 000031c0 5ac3 ..1.Z.
-
-# RUN: llvm-readobj -x 1 %p/wasm/Inputs/trivial.obj.wasm \
-# RUN: | FileCheck %s --check-prefix WASM
-
-# WASM: 0x00000000 04600001 7f60017f 017f6000 0060017f .`...`....`..`..
-# WASM: 0x00000010 00 .
diff --git a/llvm/test/tools/llvm-readobj/relocations.test b/llvm/test/tools/llvm-readobj/relocations.test
deleted file mode 100644
index 381eb2fbed9c..000000000000
--- a/llvm/test/tools/llvm-readobj/relocations.test
+++ /dev/null
@@ -1,302 +0,0 @@
-RUN: llvm-readobj -r %p/COFF/Inputs/trivial.obj.coff-i386 \
-RUN: | FileCheck %s -check-prefix COFF
-RUN: llvm-readobj -r %p/COFF/Inputs/bad-relocs.obj.coff-i386 \
-RUN: | FileCheck %s -check-prefix BAD-COFF-RELOCS
-RUN: llvm-readobj -r %p/COFF/Inputs/relocs-no-symtab.obj.coff-i386 \
-RUN: | FileCheck %s -check-prefix BAD-COFF-RELOCS
-RUN: llvm-readobj -r %p/MachO/Inputs/trivial.obj.macho-i386 \
-RUN: | FileCheck %s -check-prefix MACHO-I386
-RUN: llvm-readobj -r %p/MachO/Inputs/trivial.obj.macho-x86-64 \
-RUN: | FileCheck %s -check-prefix MACHO-X86-64
-RUN: llvm-readobj -r --expand-relocs %p/MachO/Inputs/trivial.obj.macho-ppc \
-RUN: | FileCheck %s -check-prefix MACHO-PPC
-RUN: llvm-readobj -r --expand-relocs %p/MachO/Inputs/trivial.obj.macho-ppc64 \
-RUN: | FileCheck %s -check-prefix MACHO-PPC64
-RUN: llvm-readobj -r --expand-relocs %p/MachO/Inputs/trivial.obj.macho-arm \
-RUN: | FileCheck %s -check-prefix MACHO-ARM
-RUN: llvm-readobj -r --expand-relocs %p/wasm/Inputs/trivial.obj.wasm \
-RUN: | FileCheck %s -check-prefix WASM
-
-COFF: Relocations [
-COFF-NEXT: Section (1) .text {
-COFF-NEXT: 0x4 IMAGE_REL_I386_DIR32 .data (4)
-COFF-NEXT: 0x9 IMAGE_REL_I386_REL32 _puts (7)
-COFF-NEXT: 0xE IMAGE_REL_I386_REL32 _SomeOtherFunction (8)
-COFF-NEXT: }
-COFF-NEXT: ]
-
-BAD-COFF-RELOCS: Relocations [
-BAD-COFF-RELOCS-NEXT: Section (1) sec {
-BAD-COFF-RELOCS-NEXT: 0xDEADBEEF IMAGE_REL_I386_ABSOLUTE -
-BAD-COFF-RELOCS-NEXT: }
-BAD-COFF-RELOCS-NEXT: ]
-
-MACHO-I386: Relocations [
-MACHO-I386-NEXT: Section __text {
-MACHO-I386-NEXT: 0x18 1 2 1 GENERIC_RELOC_VANILLA 0 _SomeOtherFunction
-MACHO-I386-NEXT: 0x13 1 2 1 GENERIC_RELOC_VANILLA 0 _puts
-MACHO-I386-NEXT: 0xB 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 0x22
-MACHO-I386-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 0x8
-MACHO-I386-NEXT: }
-MACHO-I386-NEXT: ]
-
-MACHO-X86-64: Relocations [
-MACHO-X86-64-NEXT: Section __text {
-MACHO-X86-64-NEXT: 0xE 1 2 1 X86_64_RELOC_BRANCH 0 _SomeOtherFunction
-MACHO-X86-64-NEXT: 0x9 1 2 1 X86_64_RELOC_BRANCH 0 _puts
-MACHO-X86-64-NEXT: 0x4 1 2 1 X86_64_RELOC_SIGNED 0 L_.str
-MACHO-X86-64-NEXT: }
-MACHO-X86-64-NEXT:]
-
-MACHO-PPC: Relocations [
-MACHO-PPC-NEXT: Section __text {
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x24
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_LO16_SECTDIFF (11)
-MACHO-PPC-NEXT: Value: 0x64
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x0
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT: Value: 0xC
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x1C
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_HA16_SECTDIFF (12)
-MACHO-PPC-NEXT: Value: 0x64
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x58
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT: Value: 0xC
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x18
-MACHO-PPC-NEXT: PCRel: 1
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_BR24 (3)
-MACHO-PPC-NEXT: Section: __picsymbolstub1 (2)
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Section __picsymbolstub1 {
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x14
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_LO16_SECTDIFF (11)
-MACHO-PPC-NEXT: Value: 0x68
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x0
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT: Value: 0x48
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0xC
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_HA16_SECTDIFF (12)
-MACHO-PPC-NEXT: Value: 0x68
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x20
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT: Value: 0x48
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Section __la_symbol_ptr {
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x0
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_VANILLA (0)
-MACHO-PPC-NEXT: Symbol: dyld_stub_binding_helper (5)
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: ]
-
-MACHO-PPC64: Relocations [
-MACHO-PPC64-NEXT: Section __text {
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x24
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (14)
-MACHO-PPC64-NEXT: Value: 0x64
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x0
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (1)
-MACHO-PPC64-NEXT: Value: 0xC
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x1C
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (12)
-MACHO-PPC64-NEXT: Value: 0x64
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x58
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (1)
-MACHO-PPC64-NEXT: Value: 0xC
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x18
-MACHO-PPC64-NEXT: PCRel: 1
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (3)
-MACHO-PPC64-NEXT: Section: __picsymbolstub1 (2)
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Section __picsymbolstub1 {
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x14
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (14)
-MACHO-PPC64-NEXT: Value: 0x6C
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x0
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (1)
-MACHO-PPC64-NEXT: Value: 0x48
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0xC
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (12)
-MACHO-PPC64-NEXT: Value: 0x6C
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x24
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (1)
-MACHO-PPC64-NEXT: Value: 0x48
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Section __la_symbol_ptr {
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x0
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 3
-MACHO-PPC64-NEXT: Type: (0)
-MACHO-PPC64-NEXT: Symbol: dyld_stub_binding_helper (5)
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: ]
-
-
-MACHO-ARM: Relocations [
-MACHO-ARM-NEXT: Section __text {
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x38
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 2
-MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
-MACHO-ARM-NEXT: Value: 0x40
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x0
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 2
-MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT: Value: 0x28
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x20
-MACHO-ARM-NEXT: PCRel: 1
-MACHO-ARM-NEXT: Length: 2
-MACHO-ARM-NEXT: Type: ARM_RELOC_BR24 (5)
-MACHO-ARM-NEXT: Symbol: _g
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x1C
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 1
-MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
-MACHO-ARM-NEXT: Symbol: _g
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x0
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 1
-MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT: Section: -
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x18
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 0
-MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
-MACHO-ARM-NEXT: Symbol: _g
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x0
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 0
-MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT: Section: -
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0xC
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 2
-MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
-MACHO-ARM-NEXT: Value: 0x44
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x0
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 2
-MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT: Value: 0x4
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: ]
-
-WASM: Relocations [
-WASM-NEXT: Section (4) CODE {
-WASM-NEXT: Relocation {
-WASM-NEXT: Type: R_WASM_MEMORY_ADDR_SLEB (4)
-WASM-NEXT: Offset: 0x4
-WASM-NEXT: Symbol: .L.str
-WASM-NEXT: Addend: 0
-WASM-NEXT: }
-WASM-NEXT: Relocation {
-WASM-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
-WASM-NEXT: Offset: 0xA
-WASM-NEXT: Symbol: puts
-WASM-NEXT: }
-WASM-NEXT: Relocation {
-WASM-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
-WASM-NEXT: Offset: 0x11
-WASM-NEXT: Symbol: .LSomeOtherFunction_bitcast
-WASM-NEXT: }
-WASM-NEXT: Relocation {
-WASM-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
-WASM-NEXT: Offset: 0x1E
-WASM-NEXT: Symbol: SomeOtherFunction
-WASM-NEXT: }
-WASM-NEXT: }
-WASM-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/sections-ext.test b/llvm/test/tools/llvm-readobj/sections-ext.test
deleted file mode 100644
index 921bf0502c83..000000000000
--- a/llvm/test/tools/llvm-readobj/sections-ext.test
+++ /dev/null
@@ -1,994 +0,0 @@
-RUN: llvm-readobj -S --st --sr --sd %p/COFF/Inputs/trivial.obj.coff-i386 \
-RUN: | FileCheck %s -check-prefix COFF
-RUN: llvm-readobj -S --st --sr --sd %p/ELF/Inputs/trivial.obj.elf-i386 \
-RUN: | FileCheck %s -check-prefix ELF
-RUN: llvm-readobj -S --st --sr --sd %p/MachO/Inputs/trivial.obj.macho-i386 \
-RUN: | FileCheck %s -check-prefix MACHO-I386
-RUN: llvm-readobj -S --st --sr --sd %p/MachO/Inputs/trivial.obj.macho-x86-64 \
-RUN: | FileCheck %s -check-prefix MACHO-X86-64
-RUN: llvm-readobj --expand-relocs -S --st --sr --sd %p/MachO/Inputs/trivial.obj.macho-ppc \
-RUN: | FileCheck %s -check-prefix MACHO-PPC
-RUN: llvm-readobj --expand-relocs -S --st --sr --sd %p/MachO/Inputs/trivial.obj.macho-ppc64 \
-RUN: | FileCheck %s -check-prefix MACHO-PPC64
-RUN: llvm-readobj --expand-relocs -S --st --sr --sd %p/MachO/Inputs/trivial.obj.macho-arm \
-RUN: | FileCheck %s -check-prefix MACHO-ARM
-
-# Check the two-letter aliases above (-st, -sr, -sd) are equivalent to their
-# full flag names.
-RUN: llvm-readobj -S --st %p/ELF/Inputs/trivial.obj.elf-i386 > %t.readobj-st-alias
-RUN: llvm-readobj -S --section-symbols %p/ELF/Inputs/trivial.obj.elf-i386 > %t.readobj-st-no-alias
-RUN:
diff %t.readobj-st-alias %t.readobj-st-no-alias
-
-RUN: llvm-readobj -S --sr %p/ELF/Inputs/trivial.obj.elf-i386 > %t.readobj-sr-alias
-RUN: llvm-readobj -S --section-relocations %p/ELF/Inputs/trivial.obj.elf-i386 > %t.readobj-sr-no-alias
-RUN:
diff %t.readobj-sr-alias %t.readobj-sr-no-alias
-
-RUN: llvm-readobj -S --sd %p/ELF/Inputs/trivial.obj.elf-i386 > %t.readobj-sd-alias
-RUN: llvm-readobj -S --section-data %p/ELF/Inputs/trivial.obj.elf-i386 > %t.readobj-sd-no-alias
-RUN:
diff %t.readobj-sd-alias %t.readobj-sd-no-alias
-
-COFF: Sections [
-COFF-NEXT: Section {
-COFF-NEXT: Number: 1
-COFF-NEXT: Name: .text (2E 74 65 78 74 00 00 00)
-COFF-NEXT: VirtualSize: 0x0
-COFF-NEXT: VirtualAddress: 0x0
-COFF-NEXT: RawDataSize: 22
-COFF-NEXT: PointerToRawData: 0x64
-COFF-NEXT: PointerToRelocations: 0x7A
-COFF-NEXT: PointerToLineNumbers: 0x0
-COFF-NEXT: RelocationCount: 3
-COFF-NEXT: LineNumberCount: 0
-COFF-NEXT: Characteristics [ (0x60500020)
-COFF-NEXT: IMAGE_SCN_ALIGN_16BYTES (0x500000)
-COFF-NEXT: IMAGE_SCN_CNT_CODE (0x20)
-COFF-NEXT: IMAGE_SCN_MEM_EXECUTE (0x20000000)
-COFF-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
-COFF-NEXT: ]
-COFF-NEXT: Relocations [
-COFF-NEXT: 0x4 IMAGE_REL_I386_DIR32 .data
-COFF-NEXT: 0x9 IMAGE_REL_I386_REL32 _puts
-COFF-NEXT: 0xE IMAGE_REL_I386_REL32 _SomeOtherFunction
-COFF-NEXT: ]
-COFF-NEXT: Symbols [
-COFF-NEXT: Symbol {
-COFF-NEXT: Name: .text
-COFF-NEXT: Value: 0
-COFF-NEXT: Section: .text (1)
-COFF-NEXT: BaseType: Null (0x0)
-COFF-NEXT: ComplexType: Null (0x0)
-COFF-NEXT: StorageClass: Static (0x3)
-COFF-NEXT: AuxSymbolCount: 1
-COFF-NEXT: AuxSectionDef {
-COFF-NEXT: Length: 22
-COFF-NEXT: RelocationCount: 3
-COFF-NEXT: LineNumberCount: 0
-COFF-NEXT: Checksum: 0x0
-COFF-NEXT: Number: 1
-COFF-NEXT: Selection: 0x0
-COFF-NEXT: }
-COFF-NEXT: }
-COFF-NEXT: Symbol {
-COFF-NEXT: Name: _main
-COFF-NEXT: Value: 0
-COFF-NEXT: Section: .text (1)
-COFF-NEXT: BaseType: Null (0x0)
-COFF-NEXT: ComplexType: Function (0x2)
-COFF-NEXT: StorageClass: External (0x2)
-COFF-NEXT: AuxSymbolCount: 0
-COFF-NEXT: }
-COFF-NEXT: ]
-COFF-NEXT: SectionData (
-COFF-NEXT: 0000: 50C70424 00000000 E8000000 00E80000 |P..$............|
-COFF-NEXT: 0010: 000031C0 5AC3 |..1.Z.|
-COFF-NEXT: )
-COFF-NEXT: }
-
-ELF: Sections [
-ELF-NEXT: Section {
-ELF-NEXT: Index: 0
-ELF-NEXT: Name: (0)
-ELF-NEXT: Type: SHT_NULL (0x0)
-ELF-NEXT: Flags [ (0x0)
-ELF-NEXT: ]
-ELF-NEXT: Address: 0x0
-ELF-NEXT: Offset: 0x0
-ELF-NEXT: Size: 0
-ELF-NEXT: Link: 0
-ELF-NEXT: Info: 0
-ELF-NEXT: AddressAlignment: 0
-ELF-NEXT: EntrySize: 0
-ELF-NEXT: Relocations [
-ELF-NEXT: ]
-ELF-NEXT: Symbols [
-ELF-NEXT: ]
-ELF-NEXT: SectionData (
-ELF-NEXT: )
-ELF-NEXT: }
-ELF-NEXT: Section {
-ELF-NEXT: Index: 1
-ELF-NEXT: Name: .text (5)
-ELF-NEXT: Type: SHT_PROGBITS (0x1)
-ELF-NEXT: Flags [ (0x6)
-ELF-NEXT: SHF_ALLOC (0x2)
-ELF-NEXT: SHF_EXECINSTR (0x4)
-ELF-NEXT: ]
-ELF-NEXT: Address: 0x0
-ELF-NEXT: Offset: 0x40
-ELF-NEXT: Size: 42
-ELF-NEXT: Link: 0
-ELF-NEXT: Info: 0
-ELF-NEXT: AddressAlignment: 16
-ELF-NEXT: EntrySize: 0
-ELF-NEXT: Relocations [
-ELF-NEXT: ]
-ELF-NEXT: Symbols [
-ELF-NEXT: Symbol {
-ELF-NEXT: Name: .text (0)
-ELF-NEXT: Value: 0x0
-ELF-NEXT: Size: 0
-ELF-NEXT: Binding: Local (0x0)
-ELF-NEXT: Type: Section (0x3)
-ELF-NEXT: Other: 0
-ELF-NEXT: Section: .text (0x1)
-ELF-NEXT: }
-ELF-NEXT: Symbol {
-ELF-NEXT: Name: main (12)
-ELF-NEXT: Value: 0x0
-ELF-NEXT: Size: 42
-ELF-NEXT: Binding: Global (0x1)
-ELF-NEXT: Type: Function (0x2)
-ELF-NEXT: Other: 0
-ELF-NEXT: Section: .text (0x1)
-ELF-NEXT: }
-ELF-NEXT: ]
-ELF-NEXT: SectionData (
-ELF-NEXT: 0000: 5383EC08 E8000000 005B81C3 03000000 |S........[......|
-ELF-NEXT: 0010: 8D830000 00008904 24E8FCFF FFFFE8FC |........$.......|
-ELF-NEXT: 0020: FFFFFF31 C083C408 5BC3 |...1....[.|
-ELF-NEXT: )
-ELF-NEXT: }
-ELF-NEXT: Section {
-ELF-NEXT: Index: 2
-ELF-NEXT: Name: .rel.text (1)
-ELF-NEXT: Type: SHT_REL (0x9)
-ELF-NEXT: Flags [ (0x0)
-ELF-NEXT: ]
-ELF-NEXT: Address: 0x0
-ELF-NEXT: Offset: 0x360
-ELF-NEXT: Size: 32
-ELF-NEXT: Link: 8
-ELF-NEXT: Info: 1
-ELF-NEXT: AddressAlignment: 4
-ELF-NEXT: EntrySize: 8
-ELF-NEXT: Relocations [
-ELF-NEXT: 0xC R_386_GOTPC _GLOBAL_OFFSET_TABLE_ 0x0
-ELF-NEXT: 0x12 R_386_GOTOFF .L.str 0x0
-ELF-NEXT: 0x1A R_386_PLT32 puts 0x0
-ELF-NEXT: 0x1F R_386_PLT32 SomeOtherFunction 0x0
-ELF-NEXT: ]
-ELF-NEXT: Symbols [
-ELF-NEXT: ]
-ELF-NEXT: SectionData (
-ELF-NEXT: 0000: 0C000000 0A0A0000 12000000 09020000 |................|
-ELF-NEXT: 0010: 1A000000 040B0000 1F000000 04090000 |................|
-ELF-NEXT: )
-ELF-NEXT: }
-
-MACHO-I386: Sections [
-MACHO-I386-NEXT: Section {
-MACHO-I386-NEXT: Index: 0
-MACHO-I386-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
-MACHO-I386-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-I386-NEXT: Address: 0x0
-MACHO-I386-NEXT: Size: 0x22
-MACHO-I386-NEXT: Offset: 324
-MACHO-I386-NEXT: Alignment: 4
-MACHO-I386-NEXT: RelocationOffset: 0x174
-MACHO-I386-NEXT: RelocationCount: 4
-MACHO-I386-NEXT: Type: Regular (0x0)
-MACHO-I386-NEXT: Attributes [ (0x800004)
-MACHO-I386-NEXT: PureInstructions (0x800000)
-MACHO-I386-NEXT: SomeInstructions (0x4)
-MACHO-I386-NEXT: ]
-MACHO-I386-NEXT: Reserved1: 0x0
-MACHO-I386-NEXT: Reserved2: 0x0
-MACHO-I386-NEXT: Relocations [
-MACHO-I386-NEXT: 0x18 1 2 1 GENERIC_RELOC_VANILLA 0 _SomeOtherFunction
-MACHO-I386-NEXT: 0x13 1 2 1 GENERIC_RELOC_VANILLA 0 _puts
-MACHO-I386-NEXT: 0xB 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 0x22
-MACHO-I386-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 0x8
-MACHO-I386-NEXT: ]
-MACHO-I386-NEXT: Symbols [
-MACHO-I386-NEXT: Symbol {
-MACHO-I386-NEXT: Name: _main (1)
-MACHO-I386-NEXT: Extern
-MACHO-I386-NEXT: Type: Section (0xE)
-MACHO-I386-NEXT: Section: __text (0x1)
-MACHO-I386-NEXT: RefType: UndefinedNonLazy (0x0)
-MACHO-I386-NEXT: Flags [ (0x0)
-MACHO-I386-NEXT: ]
-MACHO-I386-NEXT: Value: 0x0
-MACHO-I386-NEXT: }
-MACHO-I386-NEXT: ]
-MACHO-I386-NEXT: SectionData (
-MACHO-I386-NEXT: 0000: 83EC0CE8 00000000 588D801A 00000089 |........X.......|
-MACHO-I386-NEXT: 0010: 0424E8E9 FFFFFFE8 E4FFFFFF 31C083C4 |.$..........1...|
-MACHO-I386-NEXT: 0020: 0CC3 |..|
-MACHO-I386-NEXT: )
-MACHO-I386-NEXT: }
-
-
-MACHO-X86-64: Sections [
-MACHO-X86-64-NEXT: Section {
-MACHO-X86-64-NEXT: Index: 0
-MACHO-X86-64-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
-MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-X86-64-NEXT: Address: 0x0
-MACHO-X86-64-NEXT: Size: 0x16
-MACHO-X86-64-NEXT: Offset: 368
-MACHO-X86-64-NEXT: Alignment: 4
-MACHO-X86-64-NEXT: RelocationOffset: 0x194
-MACHO-X86-64-NEXT: RelocationCount: 3
-MACHO-X86-64-NEXT: Type: Regular (0x0)
-MACHO-X86-64-NEXT: Attributes [ (0x800004)
-MACHO-X86-64-NEXT: PureInstructions (0x800000)
-MACHO-X86-64-NEXT: SomeInstructions (0x4)
-MACHO-X86-64-NEXT: ]
-MACHO-X86-64-NEXT: Reserved1: 0x0
-MACHO-X86-64-NEXT: Reserved2: 0x0
-MACHO-X86-64-NEXT: Reserved3: 0x0
-MACHO-X86-64-NEXT: Relocations [
-MACHO-X86-64-NEXT: 0xE 1 2 1 X86_64_RELOC_BRANCH 0 _SomeOtherFunction
-MACHO-X86-64-NEXT: 0x9 1 2 1 X86_64_RELOC_BRANCH 0 _puts
-MACHO-X86-64-NEXT: 0x4 1 2 1 X86_64_RELOC_SIGNED 0 L_.str
-MACHO-X86-64-NEXT: ]
-MACHO-X86-64-NEXT: Symbols [
-MACHO-X86-64-NEXT: Symbol {
-MACHO-X86-64-NEXT: Name: _main (1)
-MACHO-X86-64-NEXT: Extern
-MACHO-X86-64-NEXT: Type: Section (0xE)
-MACHO-X86-64-NEXT: Section: __text (0x1)
-MACHO-X86-64-NEXT: RefType: UndefinedNonLazy (0x0)
-MACHO-X86-64-NEXT: Flags [ (0x0)
-MACHO-X86-64-NEXT: ]
-MACHO-X86-64-NEXT: Value: 0x0
-MACHO-X86-64-NEXT: }
-MACHO-X86-64-NEXT: ]
-MACHO-X86-64-NEXT: SectionData (
-MACHO-X86-64-NEXT: 0000: 50488D3D 00000000 E8000000 00E80000 |PH.=............|
-MACHO-X86-64-NEXT: 0010: 000031C0 5AC3 |..1.Z.|
-MACHO-X86-64-NEXT: )
-MACHO-X86-64-NEXT: }
-MACHO-X86-64-NEXT: Section {
-MACHO-X86-64-NEXT: Index: 1
-MACHO-X86-64-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
-MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-X86-64-NEXT: Address: 0x16
-MACHO-X86-64-NEXT: Size: 0xD
-MACHO-X86-64-NEXT: Offset: 390
-MACHO-X86-64-NEXT: Alignment: 0
-MACHO-X86-64-NEXT: RelocationOffset: 0x0
-MACHO-X86-64-NEXT: RelocationCount: 0
-MACHO-X86-64-NEXT: Type: CStringLiterals (0x2)
-MACHO-X86-64-NEXT: Attributes [ (0x0)
-MACHO-X86-64-NEXT: ]
-MACHO-X86-64-NEXT: Reserved1: 0x0
-MACHO-X86-64-NEXT: Reserved2: 0x0
-MACHO-X86-64-NEXT: Reserved3: 0x0
-MACHO-X86-64-NEXT: Relocations [
-MACHO-X86-64-NEXT: ]
-MACHO-X86-64-NEXT: Symbols [
-MACHO-X86-64-NEXT: Symbol {
-MACHO-X86-64-NEXT: Name: L_.str (32)
-MACHO-X86-64-NEXT: Type: Section (0xE)
-MACHO-X86-64-NEXT: Section: __cstring (0x2)
-MACHO-X86-64-NEXT: RefType: UndefinedNonLazy (0x0)
-MACHO-X86-64-NEXT: Flags [ (0x0)
-MACHO-X86-64-NEXT: ]
-MACHO-X86-64-NEXT: Value: 0x16
-MACHO-X86-64-NEXT: }
-MACHO-X86-64-NEXT: ]
-MACHO-X86-64-NEXT: SectionData (
-MACHO-X86-64-NEXT: 0000: 48656C6C 6F20576F 726C640A 00 |Hello World..|
-MACHO-X86-64-NEXT: )
-MACHO-X86-64-NEXT: }
-MACHO-X86-64-NEXT:]
-
-MACHO-PPC: Sections [
-MACHO-PPC-NEXT: Section {
-MACHO-PPC-NEXT: Index: 0
-MACHO-PPC-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Address: 0x0
-MACHO-PPC-NEXT: Size: 0x3C
-MACHO-PPC-NEXT: Offset: 528
-MACHO-PPC-NEXT: Alignment: 2
-MACHO-PPC-NEXT: RelocationOffset: 0x27C
-MACHO-PPC-NEXT: RelocationCount: 5
-MACHO-PPC-NEXT: Type: Regular (0x0)
-MACHO-PPC-NEXT: Attributes [ (0x800004)
-MACHO-PPC-NEXT: PureInstructions (0x800000)
-MACHO-PPC-NEXT: SomeInstructions (0x4)
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Reserved1: 0x0
-MACHO-PPC-NEXT: Reserved2: 0x0
-MACHO-PPC-NEXT: Relocations [
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x24
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_LO16_SECTDIFF (11)
-MACHO-PPC-NEXT: Value: 0x64
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x0
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT: Value: 0xC
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x1C
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_HA16_SECTDIFF (12)
-MACHO-PPC-NEXT: Value: 0x64
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x58
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT: Value: 0xC
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x18
-MACHO-PPC-NEXT: PCRel: 1
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_BR24 (3)
-MACHO-PPC-NEXT: Section: __picsymbolstub1 (2)
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Symbols [
-MACHO-PPC-NEXT: Symbol {
-MACHO-PPC-NEXT: Name: _f (4)
-MACHO-PPC-NEXT: Extern
-MACHO-PPC-NEXT: Type: Section (0xE)
-MACHO-PPC-NEXT: Section: __text (0x1)
-MACHO-PPC-NEXT: RefType: UndefinedNonLazy (0x0)
-MACHO-PPC-NEXT: Flags [ (0x0)
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Value: 0x0
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: SectionData (
-MACHO-PPC-NEXT: 0000: 7C0802A6 93E1FFFC 429F0005 7FE802A6 ||.......B.......|
-MACHO-PPC-NEXT: 0010: 90010008 9421FFB0 48000029 3C5F0000 |.....!..H..)<_..|
-MACHO-PPC-NEXT: 0020: 38210050 80420058 80010008 83E1FFFC |8!.P.B.X........|
-MACHO-PPC-NEXT: 0030: 7C0803A6 80620000 4E800020 ||....b..N.. |
-MACHO-PPC-NEXT: )
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Section {
-MACHO-PPC-NEXT: Index: 1
-MACHO-PPC-NEXT: Name: __picsymbolstub1 (5F 5F 70 69 63 73 79 6D 62 6F 6C 73 74 75 62 31)
-MACHO-PPC-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Address: 0x40
-MACHO-PPC-NEXT: Size: 0x20
-MACHO-PPC-NEXT: Offset: 592
-MACHO-PPC-NEXT: Alignment: 5
-MACHO-PPC-NEXT: RelocationOffset: 0x2A4
-MACHO-PPC-NEXT: RelocationCount: 4
-MACHO-PPC-NEXT: Type: SymbolStubs (0x8)
-MACHO-PPC-NEXT: Attributes [ (0x800004)
-MACHO-PPC-NEXT: PureInstructions (0x800000)
-MACHO-PPC-NEXT: SomeInstructions (0x4)
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Reserved1: 0x0
-MACHO-PPC-NEXT: Reserved2: 0x20
-MACHO-PPC-NEXT: Relocations [
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x14
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_LO16_SECTDIFF (11)
-MACHO-PPC-NEXT: Value: 0x68
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x0
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT: Value: 0x48
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0xC
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_HA16_SECTDIFF (12)
-MACHO-PPC-NEXT: Value: 0x68
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x20
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT: Value: 0x48
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Symbols [
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: SectionData (
-MACHO-PPC-NEXT: 0000: 7C0802A6 429F0005 7D6802A6 3D6B0000 ||...B...}h..=k..|
-MACHO-PPC-NEXT: 0010: 7C0803A6 858B0020 7D8903A6 4E800420 ||...... }...N.. |
-MACHO-PPC-NEXT: )
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Section {
-MACHO-PPC-NEXT: Index: 2
-MACHO-PPC-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Address: 0x60
-MACHO-PPC-NEXT: Size: 0x4
-MACHO-PPC-NEXT: Offset: 624
-MACHO-PPC-NEXT: Alignment: 2
-MACHO-PPC-NEXT: RelocationOffset: 0x0
-MACHO-PPC-NEXT: RelocationCount: 0
-MACHO-PPC-NEXT: Type: Regular (0x0)
-MACHO-PPC-NEXT: Attributes [ (0x0)
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Reserved1: 0x0
-MACHO-PPC-NEXT: Reserved2: 0x0
-MACHO-PPC-NEXT: Relocations [
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Symbols [
-MACHO-PPC-NEXT: Symbol {
-MACHO-PPC-NEXT: Name: _b (1)
-MACHO-PPC-NEXT: Extern
-MACHO-PPC-NEXT: Type: Section (0xE)
-MACHO-PPC-NEXT: Section: __data (0x3)
-MACHO-PPC-NEXT: RefType: UndefinedNonLazy (0x0)
-MACHO-PPC-NEXT: Flags [ (0x0)
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Value: 0x60
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: SectionData (
-MACHO-PPC-NEXT: 0000: 0000002A |...*|
-MACHO-PPC-NEXT: )
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Section {
-MACHO-PPC-NEXT: Index: 3
-MACHO-PPC-NEXT: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
-MACHO-PPC-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Address: 0x64
-MACHO-PPC-NEXT: Size: 0x4
-MACHO-PPC-NEXT: Offset: 628
-MACHO-PPC-NEXT: Alignment: 2
-MACHO-PPC-NEXT: RelocationOffset: 0x0
-MACHO-PPC-NEXT: RelocationCount: 0
-MACHO-PPC-NEXT: Type: NonLazySymbolPointers (0x6)
-MACHO-PPC-NEXT: Attributes [ (0x0)
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Reserved1: 0x1
-MACHO-PPC-NEXT: Reserved2: 0x0
-MACHO-PPC-NEXT: Relocations [
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Symbols [
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: SectionData (
-MACHO-PPC-NEXT: 0000: 00000000 |....|
-MACHO-PPC-NEXT: )
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Section {
-MACHO-PPC-NEXT: Index: 4
-MACHO-PPC-NEXT: Name: __la_symbol_ptr (5F 5F 6C 61 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
-MACHO-PPC-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Address: 0x68
-MACHO-PPC-NEXT: Size: 0x4
-MACHO-PPC-NEXT: Offset: 632
-MACHO-PPC-NEXT: Alignment: 2
-MACHO-PPC-NEXT: RelocationOffset: 0x2C4
-MACHO-PPC-NEXT: RelocationCount: 1
-MACHO-PPC-NEXT: Type: LazySymbolPointers (0x7)
-MACHO-PPC-NEXT: Attributes [ (0x0)
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Reserved1: 0x2
-MACHO-PPC-NEXT: Reserved2: 0x0
-MACHO-PPC-NEXT: Relocations [
-MACHO-PPC-NEXT: Relocation {
-MACHO-PPC-NEXT: Offset: 0x0
-MACHO-PPC-NEXT: PCRel: 0
-MACHO-PPC-NEXT: Length: 2
-MACHO-PPC-NEXT: Type: PPC_RELOC_VANILLA (0)
-MACHO-PPC-NEXT: Symbol: dyld_stub_binding_helper (5)
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Symbols [
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: SectionData (
-MACHO-PPC-NEXT: 0000: 00000000 |....|
-MACHO-PPC-NEXT: )
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: ]
-
-
-MACHO-PPC64: Sections [
-MACHO-PPC64-NEXT: Section {
-MACHO-PPC64-NEXT: Index: 0
-MACHO-PPC64-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Address: 0x0
-MACHO-PPC64-NEXT: Size: 0x3C
-MACHO-PPC64-NEXT: Offset: 608
-MACHO-PPC64-NEXT: Alignment: 2
-MACHO-PPC64-NEXT: RelocationOffset: 0x2D4
-MACHO-PPC64-NEXT: RelocationCount: 5
-MACHO-PPC64-NEXT: Type: Regular (0x0)
-MACHO-PPC64-NEXT: Attributes [ (0x800004)
-MACHO-PPC64-NEXT: PureInstructions (0x800000)
-MACHO-PPC64-NEXT: SomeInstructions (0x4)
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Reserved1: 0x0
-MACHO-PPC64-NEXT: Reserved2: 0x0
-MACHO-PPC64-NEXT: Reserved3: 0x0
-MACHO-PPC64-NEXT: Relocations [
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x24
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (14)
-MACHO-PPC64-NEXT: Value: 0x64
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x0
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (1)
-MACHO-PPC64-NEXT: Value: 0xC
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x1C
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (12)
-MACHO-PPC64-NEXT: Value: 0x64
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x58
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (1)
-MACHO-PPC64-NEXT: Value: 0xC
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x18
-MACHO-PPC64-NEXT: PCRel: 1
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (3)
-MACHO-PPC64-NEXT: Section: __picsymbolstub1 (2)
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Symbols [
-MACHO-PPC64-NEXT: Symbol {
-MACHO-PPC64-NEXT: Name: _f (4)
-MACHO-PPC64-NEXT: Extern
-MACHO-PPC64-NEXT: Type: Section (0xE)
-MACHO-PPC64-NEXT: Section: __text (0x1)
-MACHO-PPC64-NEXT: RefType: UndefinedNonLazy (0x0)
-MACHO-PPC64-NEXT: Flags [ (0x0)
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Value: 0x0
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: SectionData (
-MACHO-PPC64-NEXT: 0000: 7C0802A6 FBE1FFF8 429F0005 7FE802A6 ||.......B.......|
-MACHO-PPC64-NEXT: 0010: F8010010 F821FF81 48000029 3C5F0000 |.....!..H..)<_..|
-MACHO-PPC64-NEXT: 0020: 38210080 E8420058 E8010010 EBE1FFF8 |8!...B.X........|
-MACHO-PPC64-NEXT: 0030: 7C0803A6 E8620002 4E800020 ||....b..N.. |
-MACHO-PPC64-NEXT: )
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Section {
-MACHO-PPC64-NEXT: Index: 1
-MACHO-PPC64-NEXT: Name: __picsymbolstub1 (5F 5F 70 69 63 73 79 6D 62 6F 6C 73 74 75 62 31)
-MACHO-PPC64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Address: 0x40
-MACHO-PPC64-NEXT: Size: 0x20
-MACHO-PPC64-NEXT: Offset: 672
-MACHO-PPC64-NEXT: Alignment: 5
-MACHO-PPC64-NEXT: RelocationOffset: 0x2FC
-MACHO-PPC64-NEXT: RelocationCount: 4
-MACHO-PPC64-NEXT: Type: SymbolStubs (0x8)
-MACHO-PPC64-NEXT: Attributes [ (0x800004)
-MACHO-PPC64-NEXT: PureInstructions (0x800000)
-MACHO-PPC64-NEXT: SomeInstructions (0x4)
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Reserved1: 0x0
-MACHO-PPC64-NEXT: Reserved2: 0x20
-MACHO-PPC64-NEXT: Reserved3: 0x0
-MACHO-PPC64-NEXT: Relocations [
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x14
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (14)
-MACHO-PPC64-NEXT: Value: 0x6C
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x0
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (1)
-MACHO-PPC64-NEXT: Value: 0x48
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0xC
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (12)
-MACHO-PPC64-NEXT: Value: 0x6C
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x24
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 2
-MACHO-PPC64-NEXT: Type: (1)
-MACHO-PPC64-NEXT: Value: 0x48
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Symbols [
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: SectionData (
-MACHO-PPC64-NEXT: 0000: 7C0802A6 429F0005 7D6802A6 3D6B0000 ||...B...}h..=k..|
-MACHO-PPC64-NEXT: 0010: 7C0803A6 E98B0025 7D8903A6 4E800420 ||......%}...N.. |
-MACHO-PPC64-NEXT: )
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Section {
-MACHO-PPC64-NEXT: Index: 2
-MACHO-PPC64-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Address: 0x60
-MACHO-PPC64-NEXT: Size: 0x4
-MACHO-PPC64-NEXT: Offset: 704
-MACHO-PPC64-NEXT: Alignment: 2
-MACHO-PPC64-NEXT: RelocationOffset: 0x0
-MACHO-PPC64-NEXT: RelocationCount: 0
-MACHO-PPC64-NEXT: Type: Regular (0x0)
-MACHO-PPC64-NEXT: Attributes [ (0x0)
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Reserved1: 0x0
-MACHO-PPC64-NEXT: Reserved2: 0x0
-MACHO-PPC64-NEXT: Reserved3: 0x0
-MACHO-PPC64-NEXT: Relocations [
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Symbols [
-MACHO-PPC64-NEXT: Symbol {
-MACHO-PPC64-NEXT: Name: _b (1)
-MACHO-PPC64-NEXT: Extern
-MACHO-PPC64-NEXT: Type: Section (0xE)
-MACHO-PPC64-NEXT: Section: __data (0x3)
-MACHO-PPC64-NEXT: RefType: UndefinedNonLazy (0x0)
-MACHO-PPC64-NEXT: Flags [ (0x0)
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Value: 0x60
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: SectionData (
-MACHO-PPC64-NEXT: 0000: 0000002A |...*|
-MACHO-PPC64-NEXT: )
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Section {
-MACHO-PPC64-NEXT: Index: 3
-MACHO-PPC64-NEXT: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
-MACHO-PPC64-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Address: 0x64
-MACHO-PPC64-NEXT: Size: 0x8
-MACHO-PPC64-NEXT: Offset: 708
-MACHO-PPC64-NEXT: Alignment: 2
-MACHO-PPC64-NEXT: RelocationOffset: 0x0
-MACHO-PPC64-NEXT: RelocationCount: 0
-MACHO-PPC64-NEXT: Type: NonLazySymbolPointers (0x6)
-MACHO-PPC64-NEXT: Attributes [ (0x0)
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Reserved1: 0x1
-MACHO-PPC64-NEXT: Reserved2: 0x0
-MACHO-PPC64-NEXT: Reserved3: 0x0
-MACHO-PPC64-NEXT: Relocations [
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Symbols [
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: SectionData (
-MACHO-PPC64-NEXT: 0000: 00000000 00000000 |........|
-MACHO-PPC64-NEXT: )
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Section {
-MACHO-PPC64-NEXT: Index: 4
-MACHO-PPC64-NEXT: Name: __la_symbol_ptr (5F 5F 6C 61 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
-MACHO-PPC64-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Address: 0x6C
-MACHO-PPC64-NEXT: Size: 0x8
-MACHO-PPC64-NEXT: Offset: 716
-MACHO-PPC64-NEXT: Alignment: 2
-MACHO-PPC64-NEXT: RelocationOffset: 0x31C
-MACHO-PPC64-NEXT: RelocationCount: 1
-MACHO-PPC64-NEXT: Type: LazySymbolPointers (0x7)
-MACHO-PPC64-NEXT: Attributes [ (0x0)
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Reserved1: 0x2
-MACHO-PPC64-NEXT: Reserved2: 0x0
-MACHO-PPC64-NEXT: Reserved3: 0x0
-MACHO-PPC64-NEXT: Relocations [
-MACHO-PPC64-NEXT: Relocation {
-MACHO-PPC64-NEXT: Offset: 0x0
-MACHO-PPC64-NEXT: PCRel: 0
-MACHO-PPC64-NEXT: Length: 3
-MACHO-PPC64-NEXT: Type: (0)
-MACHO-PPC64-NEXT: Symbol: dyld_stub_binding_helper (5)
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Symbols [
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: SectionData (
-MACHO-PPC64-NEXT: 0000: 00000000 00000000 |........|
-MACHO-PPC64-NEXT: )
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: ]
-
-MACHO-ARM: Sections [
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 0
-MACHO-ARM-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x0
-MACHO-ARM-NEXT: Size: 0x3C
-MACHO-ARM-NEXT: Offset: 664
-MACHO-ARM-NEXT: Alignment: 2
-MACHO-ARM-NEXT: RelocationOffset: 0x2E0
-MACHO-ARM-NEXT: RelocationCount: 9
-MACHO-ARM-NEXT: Type: Regular (0x0)
-MACHO-ARM-NEXT: Attributes [ (0x800004)
-MACHO-ARM-NEXT: PureInstructions (0x800000)
-MACHO-ARM-NEXT: SomeInstructions (0x4)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x0
-MACHO-ARM-NEXT: Relocations [
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x38
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 2
-MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
-MACHO-ARM-NEXT: Value: 0x40
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x0
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 2
-MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT: Value: 0x28
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x20
-MACHO-ARM-NEXT: PCRel: 1
-MACHO-ARM-NEXT: Length: 2
-MACHO-ARM-NEXT: Type: ARM_RELOC_BR24 (5)
-MACHO-ARM-NEXT: Symbol: _g
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x1C
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 1
-MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
-MACHO-ARM-NEXT: Symbol: _g
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x0
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 1
-MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT: Section: -
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x18
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 0
-MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
-MACHO-ARM-NEXT: Symbol: _g
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x0
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 0
-MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT: Section: -
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0xC
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 2
-MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
-MACHO-ARM-NEXT: Value: 0x44
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Relocation {
-MACHO-ARM-NEXT: Offset: 0x0
-MACHO-ARM-NEXT: PCRel: 0
-MACHO-ARM-NEXT: Length: 2
-MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT: Value: 0x4
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Symbols [
-MACHO-ARM-NEXT: Symbol {
-MACHO-ARM-NEXT: Name: _f (4)
-MACHO-ARM-NEXT: Extern
-MACHO-ARM-NEXT: Type: Section (0xE)
-MACHO-ARM-NEXT: Section: __text (0x1)
-MACHO-ARM-NEXT: RefType: UndefinedNonLazy (0x0)
-MACHO-ARM-NEXT: Flags [ (0x0)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Value: 0x10
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Symbol {
-MACHO-ARM-NEXT: Name: _h (1)
-MACHO-ARM-NEXT: Extern
-MACHO-ARM-NEXT: Type: Section (0xE)
-MACHO-ARM-NEXT: Section: __text (0x1)
-MACHO-ARM-NEXT: RefType: UndefinedNonLazy (0x0)
-MACHO-ARM-NEXT: Flags [ (0x0)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Value: 0x0
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: SectionData (
-MACHO-ARM-NEXT: 0000: 04009FE5 00009FE7 1EFF2FE1 38000000 |........../.8...|
-MACHO-ARM-NEXT: 0010: 80402DE9 0D70A0E1 000000E3 000040E3 |. at -..p........@.|
-MACHO-ARM-NEXT: 0020: F6FFFFEB 0C009FE5 00009FE7 000090E5 |................|
-MACHO-ARM-NEXT: 0030: 8040BDE8 1EFF2FE1 10000000 |. at ..../.....|
-MACHO-ARM-NEXT: )
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 1
-MACHO-ARM-NEXT: Name: __textcoal_nt (5F 5F 74 65 78 74 63 6F 61 6C 5F 6E 74 00 00 00)
-MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x3C
-MACHO-ARM-NEXT: Size: 0x0
-MACHO-ARM-NEXT: Offset: 724
-MACHO-ARM-NEXT: Alignment: 0
-MACHO-ARM-NEXT: RelocationOffset: 0x0
-MACHO-ARM-NEXT: RelocationCount: 0
-MACHO-ARM-NEXT: Type: Coalesced (0xB)
-MACHO-ARM-NEXT: Attributes [ (0x800000)
-MACHO-ARM-NEXT: PureInstructions (0x800000)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x0
-MACHO-ARM-NEXT: Relocations [
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Symbols [
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: SectionData (
-MACHO-ARM-NEXT: )
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 2
-MACHO-ARM-NEXT: Name: __const_coal (5F 5F 63 6F 6E 73 74 5F 63 6F 61 6C 00 00 00 00)
-MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x3C
-MACHO-ARM-NEXT: Size: 0x0
-MACHO-ARM-NEXT: Offset: 724
-MACHO-ARM-NEXT: Alignment: 0
-MACHO-ARM-NEXT: RelocationOffset: 0x0
-MACHO-ARM-NEXT: RelocationCount: 0
-MACHO-ARM-NEXT: Type: Coalesced (0xB)
-MACHO-ARM-NEXT: Attributes [ (0x0)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x0
-MACHO-ARM-NEXT: Relocations [
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Symbols [
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: SectionData (
-MACHO-ARM-NEXT: )
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 3
-MACHO-ARM-NEXT: Name: __picsymbolstub4 (5F 5F 70 69 63 73 79 6D 62 6F 6C 73 74 75 62 34)
-MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x3C
-MACHO-ARM-NEXT: Size: 0x0
-MACHO-ARM-NEXT: Offset: 724
-MACHO-ARM-NEXT: Alignment: 0
-MACHO-ARM-NEXT: RelocationOffset: 0x0
-MACHO-ARM-NEXT: RelocationCount: 0
-MACHO-ARM-NEXT: Type: SymbolStubs (0x8)
-MACHO-ARM-NEXT: Attributes [ (0x0)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x10
-MACHO-ARM-NEXT: Relocations [
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Symbols [
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: SectionData (
-MACHO-ARM-NEXT: )
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 4
-MACHO-ARM-NEXT: Name: __StaticInit (5F 5F 53 74 61 74 69 63 49 6E 69 74 00 00 00 00)
-MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x3C
-MACHO-ARM-NEXT: Size: 0x0
-MACHO-ARM-NEXT: Offset: 724
-MACHO-ARM-NEXT: Alignment: 0
-MACHO-ARM-NEXT: RelocationOffset: 0x0
-MACHO-ARM-NEXT: RelocationCount: 0
-MACHO-ARM-NEXT: Type: Regular (0x0)
-MACHO-ARM-NEXT: Attributes [ (0x800000)
-MACHO-ARM-NEXT: PureInstructions (0x800000)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x0
-MACHO-ARM-NEXT: Relocations [
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Symbols [
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: SectionData (
-MACHO-ARM-NEXT: )
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 5
-MACHO-ARM-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x3C
-MACHO-ARM-NEXT: Size: 0x4
-MACHO-ARM-NEXT: Offset: 724
-MACHO-ARM-NEXT: Alignment: 2
-MACHO-ARM-NEXT: RelocationOffset: 0x0
-MACHO-ARM-NEXT: RelocationCount: 0
-MACHO-ARM-NEXT: Type: Regular (0x0)
-MACHO-ARM-NEXT: Attributes [ (0x0)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x0
-MACHO-ARM-NEXT: Relocations [
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Symbols [
-MACHO-ARM-NEXT: Symbol {
-MACHO-ARM-NEXT: Name: _b (10)
-MACHO-ARM-NEXT: Extern
-MACHO-ARM-NEXT: Type: Section (0xE)
-MACHO-ARM-NEXT: Section: __data (0x6)
-MACHO-ARM-NEXT: RefType: UndefinedNonLazy (0x0)
-MACHO-ARM-NEXT: Flags [ (0x0)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Value: 0x3C
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: SectionData (
-MACHO-ARM-NEXT: 0000: 2A000000 |*...|
-MACHO-ARM-NEXT: )
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 6
-MACHO-ARM-NEXT: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
-MACHO-ARM-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x40
-MACHO-ARM-NEXT: Size: 0x8
-MACHO-ARM-NEXT: Offset: 728
-MACHO-ARM-NEXT: Alignment: 2
-MACHO-ARM-NEXT: RelocationOffset: 0x0
-MACHO-ARM-NEXT: RelocationCount: 0
-MACHO-ARM-NEXT: Type: NonLazySymbolPointers (0x6)
-MACHO-ARM-NEXT: Attributes [ (0x0)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x0
-MACHO-ARM-NEXT: Relocations [
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Symbols [
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: SectionData (
-MACHO-ARM-NEXT: 0000: 00000000 00000000 |........|
-MACHO-ARM-NEXT: )
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/sections.test b/llvm/test/tools/llvm-readobj/sections.test
deleted file mode 100644
index 77fb0904845a..000000000000
--- a/llvm/test/tools/llvm-readobj/sections.test
+++ /dev/null
@@ -1,548 +0,0 @@
-RUN: llvm-readobj --sections %p/COFF/Inputs/trivial.obj.coff-i386 \
-RUN: | FileCheck %s -check-prefix COFF
-RUN: llvm-readobj --sections %p/ELF/Inputs/trivial.obj.elf-i386 \
-RUN: | FileCheck %s -check-prefix ELF
-RUN: llvm-readobj --sections %p/ELF/Inputs/trivial.obj.elf-mipsel \
-RUN: | FileCheck %s -check-prefix ELF-MIPSEL
-RUN: llvm-readobj --sections %p/MachO/Inputs/trivial.obj.macho-i386 \
-RUN: | FileCheck %s -check-prefix MACHO-I386
-RUN: llvm-readobj --sections %p/MachO/Inputs/trivial.obj.macho-x86-64 \
-RUN: | FileCheck %s -check-prefix MACHO-X86-64
-RUN: llvm-readobj --sections %p/MachO/Inputs/trivial.obj.macho-ppc \
-RUN: | FileCheck %s -check-prefix MACHO-PPC
-RUN: llvm-readobj --sections %p/MachO/Inputs/trivial.obj.macho-ppc64 \
-RUN: | FileCheck %s -check-prefix MACHO-PPC64
-RUN: llvm-readobj --sections %p/MachO/Inputs/trivial.obj.macho-arm \
-RUN: | FileCheck %s -check-prefix MACHO-ARM
-RUN: llvm-readobj --sections %p/wasm/Inputs/trivial.obj.wasm \
-RUN: | FileCheck %s -check-prefix WASM
-
-# Check flag aliases produce identical output.
-RUN: llvm-readobj --sections %p/ELF/Inputs/trivial.obj.elf-i386 > %t.sections
-RUN: llvm-readobj -S %p/ELF/Inputs/trivial.obj.elf-i386 > %t.uppers
-RUN: cmp %t.sections %t.uppers
-RUN: llvm-readobj -S %p/ELF/Inputs/trivial.obj.elf-i386 > %t.lowers
-RUN: cmp %t.sections %t.lowers
-
-COFF: Sections [
-COFF-NEXT: Section {
-COFF-NEXT: Number: 1
-COFF-NEXT: Name: .text (2E 74 65 78 74 00 00 00)
-COFF-NEXT: VirtualSize: 0x0
-COFF-NEXT: VirtualAddress: 0x0
-COFF-NEXT: RawDataSize: 22
-COFF-NEXT: PointerToRawData: 0x64
-COFF-NEXT: PointerToRelocations: 0x7A
-COFF-NEXT: PointerToLineNumbers: 0x0
-COFF-NEXT: RelocationCount: 3
-COFF-NEXT: LineNumberCount: 0
-COFF-NEXT: Characteristics [ (0x60500020)
-COFF-NEXT: IMAGE_SCN_ALIGN_16BYTES (0x500000)
-COFF-NEXT: IMAGE_SCN_CNT_CODE (0x20)
-COFF-NEXT: IMAGE_SCN_MEM_EXECUTE (0x20000000)
-COFF-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
-COFF-NEXT: ]
-COFF-NEXT: }
-COFF-NEXT: Section {
-COFF-NEXT: Number: 2
-COFF-NEXT: Name: .data (2E 64 61 74 61 00 00 00)
-COFF-NEXT: VirtualSize: 0x0
-COFF-NEXT: VirtualAddress: 0x0
-COFF-NEXT: RawDataSize: 13
-COFF-NEXT: PointerToRawData: 0x98
-COFF-NEXT: PointerToRelocations: 0x0
-COFF-NEXT: PointerToLineNumbers: 0x0
-COFF-NEXT: RelocationCount: 0
-COFF-NEXT: LineNumberCount: 0
-COFF-NEXT: Characteristics [ (0xC0300040)
-COFF-NEXT: IMAGE_SCN_ALIGN_4BYTES (0x300000)
-COFF-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)
-COFF-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
-COFF-NEXT: IMAGE_SCN_MEM_WRITE (0x80000000)
-COFF-NEXT: ]
-COFF-NEXT: }
-COFF-NEXT: ]
-
-ELF: Sections [
-ELF-NEXT: Section {
-ELF-NEXT: Index: 0
-ELF-NEXT: Name: (0)
-ELF-NEXT: Type: SHT_NULL (0x0)
-ELF-NEXT: Flags [ (0x0)
-ELF-NEXT: ]
-ELF-NEXT: Address: 0x0
-ELF-NEXT: Offset: 0x0
-ELF-NEXT: Size: 0
-ELF-NEXT: Link: 0
-ELF-NEXT: Info: 0
-ELF-NEXT: AddressAlignment: 0
-ELF-NEXT: EntrySize: 0
-ELF-NEXT: }
-ELF-NEXT: Section {
-ELF-NEXT: Index: 1
-ELF-NEXT: Name: .text (5)
-ELF-NEXT: Type: SHT_PROGBITS (0x1)
-ELF-NEXT: Flags [ (0x6)
-ELF-NEXT: SHF_ALLOC (0x2)
-ELF-NEXT: SHF_EXECINSTR (0x4)
-ELF-NEXT: ]
-ELF-NEXT: Address: 0x0
-ELF-NEXT: Offset: 0x40
-ELF-NEXT: Size: 42
-ELF-NEXT: Link: 0
-ELF-NEXT: Info: 0
-ELF-NEXT: AddressAlignment: 16
-ELF-NEXT: EntrySize: 0
-ELF-NEXT: }
-
-ELF-MIPSEL: Section {
-ELF-MIPSEL: Index: 4
-ELF-MIPSEL-NEXT: Name: .reginfo (27)
-ELF-MIPSEL-NEXT: Type: SHT_MIPS_REGINFO (0x70000006)
-ELF-MIPSEL-NEXT: Flags [ (0x2)
-ELF-MIPSEL-NEXT: SHF_ALLOC (0x2)
-ELF-MIPSEL-NEXT: ]
-ELF-MIPSEL-NEXT: Address: 0x0
-ELF-MIPSEL-NEXT: Offset: 0x34
-ELF-MIPSEL-NEXT: Size: 24
-ELF-MIPSEL-NEXT: Link: 0
-ELF-MIPSEL-NEXT: Info: 0
-ELF-MIPSEL-NEXT: AddressAlignment: 1
-ELF-MIPSEL-NEXT: EntrySize: 0
-ELF-MIPSEL-NEXT: }
-ELF-MIPSEL-NEXT: Section {
-ELF-MIPSEL-NEXT: Index: 5
-ELF-MIPSEL-NEXT: Name: .MIPS.abiflags (12)
-ELF-MIPSEL-NEXT: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
-ELF-MIPSEL-NEXT: Flags [ (0x2)
-ELF-MIPSEL-NEXT: SHF_ALLOC (0x2)
-ELF-MIPSEL-NEXT: ]
-ELF-MIPSEL-NEXT: Address: 0x0
-ELF-MIPSEL-NEXT: Offset: 0x50
-ELF-MIPSEL-NEXT: Size: 24
-ELF-MIPSEL-NEXT: Link: 0
-ELF-MIPSEL-NEXT: Info: 0
-ELF-MIPSEL-NEXT: AddressAlignment: 8
-ELF-MIPSEL-NEXT: EntrySize: 0
-ELF-MIPSEL-NEXT: }
-
-MACHO-I386: Sections [
-MACHO-I386-NEXT: Section {
-MACHO-I386-NEXT: Index: 0
-MACHO-I386-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
-MACHO-I386-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-I386-NEXT: Address: 0x0
-MACHO-I386-NEXT: Size: 0x22
-MACHO-I386-NEXT: Offset: 324
-MACHO-I386-NEXT: Alignment: 4
-MACHO-I386-NEXT: RelocationOffset: 0x174
-MACHO-I386-NEXT: RelocationCount: 4
-MACHO-I386-NEXT: Type: Regular (0x0)
-MACHO-I386-NEXT: Attributes [ (0x800004)
-MACHO-I386-NEXT: PureInstructions (0x800000)
-MACHO-I386-NEXT: SomeInstructions (0x4)
-MACHO-I386-NEXT: ]
-MACHO-I386-NEXT: Reserved1: 0x0
-MACHO-I386-NEXT: Reserved2: 0x0
-MACHO-I386-NEXT: }
-MACHO-I386-NEXT: Section {
-MACHO-I386-NEXT: Index: 1
-MACHO-I386-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
-MACHO-I386-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-I386-NEXT: Address: 0x22
-MACHO-I386-NEXT: Size: 0xD
-MACHO-I386-NEXT: Offset: 358
-MACHO-I386-NEXT: Alignment: 0
-MACHO-I386-NEXT: RelocationOffset: 0x0
-MACHO-I386-NEXT: RelocationCount: 0
-MACHO-I386-NEXT: Type: CStringLiterals (0x2)
-MACHO-I386-NEXT: Attributes [ (0x0)
-MACHO-I386-NEXT: ]
-MACHO-I386-NEXT: Reserved1: 0x0
-MACHO-I386-NEXT: Reserved2: 0x0
-MACHO-I386-NEXT: }
-
-
-MACHO-X86-64: Sections [
-MACHO-X86-64-NEXT: Section {
-MACHO-X86-64-NEXT: Index: 0
-MACHO-X86-64-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
-MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-X86-64-NEXT: Address: 0x0
-MACHO-X86-64-NEXT: Size: 0x16
-MACHO-X86-64-NEXT: Offset: 368
-MACHO-X86-64-NEXT: Alignment: 4
-MACHO-X86-64-NEXT: RelocationOffset: 0x194
-MACHO-X86-64-NEXT: RelocationCount: 3
-MACHO-X86-64-NEXT: Type: Regular (0x0)
-MACHO-X86-64-NEXT: Attributes [ (0x800004)
-MACHO-X86-64-NEXT: PureInstructions (0x800000)
-MACHO-X86-64-NEXT: SomeInstructions (0x4)
-MACHO-X86-64-NEXT: ]
-MACHO-X86-64-NEXT: Reserved1: 0x0
-MACHO-X86-64-NEXT: Reserved2: 0x0
-MACHO-X86-64-NEXT: Reserved3: 0x0
-MACHO-X86-64-NEXT: }
-MACHO-X86-64-NEXT: Section {
-MACHO-X86-64-NEXT: Index: 1
-MACHO-X86-64-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
-MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-X86-64-NEXT: Address: 0x16
-MACHO-X86-64-NEXT: Size: 0xD
-MACHO-X86-64-NEXT: Offset: 390
-MACHO-X86-64-NEXT: Alignment: 0
-MACHO-X86-64-NEXT: RelocationOffset: 0x0
-MACHO-X86-64-NEXT: RelocationCount: 0
-MACHO-X86-64-NEXT: Type: CStringLiterals (0x2)
-MACHO-X86-64-NEXT: Attributes [ (0x0)
-MACHO-X86-64-NEXT: ]
-MACHO-X86-64-NEXT: Reserved1: 0x0
-MACHO-X86-64-NEXT: Reserved2: 0x0
-MACHO-X86-64-NEXT: Reserved3: 0x0
-MACHO-X86-64-NEXT: }
-MACHO-X86-64-NEXT:]
-
-MACHO-PPC: Sections [
-MACHO-PPC-NEXT: Section {
-MACHO-PPC-NEXT: Index: 0
-MACHO-PPC-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Address: 0x0
-MACHO-PPC-NEXT: Size: 0x3C
-MACHO-PPC-NEXT: Offset: 528
-MACHO-PPC-NEXT: Alignment: 2
-MACHO-PPC-NEXT: RelocationOffset: 0x27C
-MACHO-PPC-NEXT: RelocationCount: 5
-MACHO-PPC-NEXT: Type: Regular (0x0)
-MACHO-PPC-NEXT: Attributes [ (0x800004)
-MACHO-PPC-NEXT: PureInstructions (0x800000)
-MACHO-PPC-NEXT: SomeInstructions (0x4)
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Reserved1: 0x0
-MACHO-PPC-NEXT: Reserved2: 0x0
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Section {
-MACHO-PPC-NEXT: Index: 1
-MACHO-PPC-NEXT: Name: __picsymbolstub1 (5F 5F 70 69 63 73 79 6D 62 6F 6C 73 74 75 62 31)
-MACHO-PPC-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Address: 0x40
-MACHO-PPC-NEXT: Size: 0x20
-MACHO-PPC-NEXT: Offset: 592
-MACHO-PPC-NEXT: Alignment: 5
-MACHO-PPC-NEXT: RelocationOffset: 0x2A4
-MACHO-PPC-NEXT: RelocationCount: 4
-MACHO-PPC-NEXT: Type: SymbolStubs (0x8)
-MACHO-PPC-NEXT: Attributes [ (0x800004)
-MACHO-PPC-NEXT: PureInstructions (0x800000)
-MACHO-PPC-NEXT: SomeInstructions (0x4)
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Reserved1: 0x0
-MACHO-PPC-NEXT: Reserved2: 0x20
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Section {
-MACHO-PPC-NEXT: Index: 2
-MACHO-PPC-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Address: 0x60
-MACHO-PPC-NEXT: Size: 0x4
-MACHO-PPC-NEXT: Offset: 624
-MACHO-PPC-NEXT: Alignment: 2
-MACHO-PPC-NEXT: RelocationOffset: 0x0
-MACHO-PPC-NEXT: RelocationCount: 0
-MACHO-PPC-NEXT: Type: Regular (0x0)
-MACHO-PPC-NEXT: Attributes [ (0x0)
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Reserved1: 0x0
-MACHO-PPC-NEXT: Reserved2: 0x0
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Section {
-MACHO-PPC-NEXT: Index: 3
-MACHO-PPC-NEXT: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
-MACHO-PPC-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Address: 0x64
-MACHO-PPC-NEXT: Size: 0x4
-MACHO-PPC-NEXT: Offset: 628
-MACHO-PPC-NEXT: Alignment: 2
-MACHO-PPC-NEXT: RelocationOffset: 0x0
-MACHO-PPC-NEXT: RelocationCount: 0
-MACHO-PPC-NEXT: Type: NonLazySymbolPointers (0x6)
-MACHO-PPC-NEXT: Attributes [ (0x0)
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Reserved1: 0x1
-MACHO-PPC-NEXT: Reserved2: 0x0
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: Section {
-MACHO-PPC-NEXT: Index: 4
-MACHO-PPC-NEXT: Name: __la_symbol_ptr (5F 5F 6C 61 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
-MACHO-PPC-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC-NEXT: Address: 0x68
-MACHO-PPC-NEXT: Size: 0x4
-MACHO-PPC-NEXT: Offset: 632
-MACHO-PPC-NEXT: Alignment: 2
-MACHO-PPC-NEXT: RelocationOffset: 0x2C4
-MACHO-PPC-NEXT: RelocationCount: 1
-MACHO-PPC-NEXT: Type: LazySymbolPointers (0x7)
-MACHO-PPC-NEXT: Attributes [ (0x0)
-MACHO-PPC-NEXT: ]
-MACHO-PPC-NEXT: Reserved1: 0x2
-MACHO-PPC-NEXT: Reserved2: 0x0
-MACHO-PPC-NEXT: }
-MACHO-PPC-NEXT: ]
-
-MACHO-PPC64: Sections [
-MACHO-PPC64-NEXT: Section {
-MACHO-PPC64-NEXT: Index: 0
-MACHO-PPC64-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Address: 0x0
-MACHO-PPC64-NEXT: Size: 0x3C
-MACHO-PPC64-NEXT: Offset: 608
-MACHO-PPC64-NEXT: Alignment: 2
-MACHO-PPC64-NEXT: RelocationOffset: 0x2D4
-MACHO-PPC64-NEXT: RelocationCount: 5
-MACHO-PPC64-NEXT: Type: Regular (0x0)
-MACHO-PPC64-NEXT: Attributes [ (0x800004)
-MACHO-PPC64-NEXT: PureInstructions (0x800000)
-MACHO-PPC64-NEXT: SomeInstructions (0x4)
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Reserved1: 0x0
-MACHO-PPC64-NEXT: Reserved2: 0x0
-MACHO-PPC64-NEXT: Reserved3: 0x0
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Section {
-MACHO-PPC64-NEXT: Index: 1
-MACHO-PPC64-NEXT: Name: __picsymbolstub1 (5F 5F 70 69 63 73 79 6D 62 6F 6C 73 74 75 62 31)
-MACHO-PPC64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Address: 0x40
-MACHO-PPC64-NEXT: Size: 0x20
-MACHO-PPC64-NEXT: Offset: 672
-MACHO-PPC64-NEXT: Alignment: 5
-MACHO-PPC64-NEXT: RelocationOffset: 0x2FC
-MACHO-PPC64-NEXT: RelocationCount: 4
-MACHO-PPC64-NEXT: Type: SymbolStubs (0x8)
-MACHO-PPC64-NEXT: Attributes [ (0x800004)
-MACHO-PPC64-NEXT: PureInstructions (0x800000)
-MACHO-PPC64-NEXT: SomeInstructions (0x4)
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Reserved1: 0x0
-MACHO-PPC64-NEXT: Reserved2: 0x20
-MACHO-PPC64-NEXT: Reserved3: 0x0
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Section {
-MACHO-PPC64-NEXT: Index: 2
-MACHO-PPC64-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Address: 0x60
-MACHO-PPC64-NEXT: Size: 0x4
-MACHO-PPC64-NEXT: Offset: 704
-MACHO-PPC64-NEXT: Alignment: 2
-MACHO-PPC64-NEXT: RelocationOffset: 0x0
-MACHO-PPC64-NEXT: RelocationCount: 0
-MACHO-PPC64-NEXT: Type: Regular (0x0)
-MACHO-PPC64-NEXT: Attributes [ (0x0)
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Reserved1: 0x0
-MACHO-PPC64-NEXT: Reserved2: 0x0
-MACHO-PPC64-NEXT: Reserved3: 0x0
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Section {
-MACHO-PPC64-NEXT: Index: 3
-MACHO-PPC64-NEXT: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
-MACHO-PPC64-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Address: 0x64
-MACHO-PPC64-NEXT: Size: 0x8
-MACHO-PPC64-NEXT: Offset: 708
-MACHO-PPC64-NEXT: Alignment: 2
-MACHO-PPC64-NEXT: RelocationOffset: 0x0
-MACHO-PPC64-NEXT: RelocationCount: 0
-MACHO-PPC64-NEXT: Type: NonLazySymbolPointers (0x6)
-MACHO-PPC64-NEXT: Attributes [ (0x0)
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Reserved1: 0x1
-MACHO-PPC64-NEXT: Reserved2: 0x0
-MACHO-PPC64-NEXT: Reserved3: 0x0
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: Section {
-MACHO-PPC64-NEXT: Index: 4
-MACHO-PPC64-NEXT: Name: __la_symbol_ptr (5F 5F 6C 61 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
-MACHO-PPC64-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-PPC64-NEXT: Address: 0x6C
-MACHO-PPC64-NEXT: Size: 0x8
-MACHO-PPC64-NEXT: Offset: 716
-MACHO-PPC64-NEXT: Alignment: 2
-MACHO-PPC64-NEXT: RelocationOffset: 0x31C
-MACHO-PPC64-NEXT: RelocationCount: 1
-MACHO-PPC64-NEXT: Type: LazySymbolPointers (0x7)
-MACHO-PPC64-NEXT: Attributes [ (0x0)
-MACHO-PPC64-NEXT: ]
-MACHO-PPC64-NEXT: Reserved1: 0x2
-MACHO-PPC64-NEXT: Reserved2: 0x0
-MACHO-PPC64-NEXT: Reserved3: 0x0
-MACHO-PPC64-NEXT: }
-MACHO-PPC64-NEXT: ]
-
-MACHO-ARM: Sections [
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 0
-MACHO-ARM-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x0
-MACHO-ARM-NEXT: Size: 0x3C
-MACHO-ARM-NEXT: Offset: 664
-MACHO-ARM-NEXT: Alignment: 2
-MACHO-ARM-NEXT: RelocationOffset: 0x2E0
-MACHO-ARM-NEXT: RelocationCount: 9
-MACHO-ARM-NEXT: Type: Regular (0x0)
-MACHO-ARM-NEXT: Attributes [ (0x800004)
-MACHO-ARM-NEXT: PureInstructions (0x800000)
-MACHO-ARM-NEXT: SomeInstructions (0x4)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x0
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 1
-MACHO-ARM-NEXT: Name: __textcoal_nt (5F 5F 74 65 78 74 63 6F 61 6C 5F 6E 74 00 00 00)
-MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x3C
-MACHO-ARM-NEXT: Size: 0x0
-MACHO-ARM-NEXT: Offset: 724
-MACHO-ARM-NEXT: Alignment: 0
-MACHO-ARM-NEXT: RelocationOffset: 0x0
-MACHO-ARM-NEXT: RelocationCount: 0
-MACHO-ARM-NEXT: Type: Coalesced (0xB)
-MACHO-ARM-NEXT: Attributes [ (0x800000)
-MACHO-ARM-NEXT: PureInstructions (0x800000)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x0
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 2
-MACHO-ARM-NEXT: Name: __const_coal (5F 5F 63 6F 6E 73 74 5F 63 6F 61 6C 00 00 00 00)
-MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x3C
-MACHO-ARM-NEXT: Size: 0x0
-MACHO-ARM-NEXT: Offset: 724
-MACHO-ARM-NEXT: Alignment: 0
-MACHO-ARM-NEXT: RelocationOffset: 0x0
-MACHO-ARM-NEXT: RelocationCount: 0
-MACHO-ARM-NEXT: Type: Coalesced (0xB)
-MACHO-ARM-NEXT: Attributes [ (0x0)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x0
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 3
-MACHO-ARM-NEXT: Name: __picsymbolstub4 (5F 5F 70 69 63 73 79 6D 62 6F 6C 73 74 75 62 34)
-MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x3C
-MACHO-ARM-NEXT: Size: 0x0
-MACHO-ARM-NEXT: Offset: 724
-MACHO-ARM-NEXT: Alignment: 0
-MACHO-ARM-NEXT: RelocationOffset: 0x0
-MACHO-ARM-NEXT: RelocationCount: 0
-MACHO-ARM-NEXT: Type: SymbolStubs (0x8)
-MACHO-ARM-NEXT: Attributes [ (0x0)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x10
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 4
-MACHO-ARM-NEXT: Name: __StaticInit (5F 5F 53 74 61 74 69 63 49 6E 69 74 00 00 00 00)
-MACHO-ARM-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x3C
-MACHO-ARM-NEXT: Size: 0x0
-MACHO-ARM-NEXT: Offset: 724
-MACHO-ARM-NEXT: Alignment: 0
-MACHO-ARM-NEXT: RelocationOffset: 0x0
-MACHO-ARM-NEXT: RelocationCount: 0
-MACHO-ARM-NEXT: Type: Regular (0x0)
-MACHO-ARM-NEXT: Attributes [ (0x800000)
-MACHO-ARM-NEXT: PureInstructions (0x800000)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x0
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 5
-MACHO-ARM-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x3C
-MACHO-ARM-NEXT: Size: 0x4
-MACHO-ARM-NEXT: Offset: 724
-MACHO-ARM-NEXT: Alignment: 2
-MACHO-ARM-NEXT: RelocationOffset: 0x0
-MACHO-ARM-NEXT: RelocationCount: 0
-MACHO-ARM-NEXT: Type: Regular (0x0)
-MACHO-ARM-NEXT: Attributes [ (0x0)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x0
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT: Section {
-MACHO-ARM-NEXT: Index: 6
-MACHO-ARM-NEXT: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
-MACHO-ARM-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
-MACHO-ARM-NEXT: Address: 0x40
-MACHO-ARM-NEXT: Size: 0x8
-MACHO-ARM-NEXT: Offset: 728
-MACHO-ARM-NEXT: Alignment: 2
-MACHO-ARM-NEXT: RelocationOffset: 0x0
-MACHO-ARM-NEXT: RelocationCount: 0
-MACHO-ARM-NEXT: Type: NonLazySymbolPointers (0x6)
-MACHO-ARM-NEXT: Attributes [ (0x0)
-MACHO-ARM-NEXT: ]
-MACHO-ARM-NEXT: Reserved1: 0x0
-MACHO-ARM-NEXT: Reserved2: 0x0
-MACHO-ARM-NEXT: }
-MACHO-ARM-NEXT:]
-
-WASM: Sections [
-WASM-NEXT: Section {
-WASM-NEXT: Type: TYPE (0x1)
-WASM-NEXT: Size: 17
-WASM-NEXT: Offset: 8
-WASM-NEXT: }
-WASM-NEXT: Section {
-WASM-NEXT: Type: IMPORT (0x2)
-WASM-NEXT: Size: 93
-WASM-NEXT: Offset: 31
-WASM-NEXT: }
-WASM-NEXT: Section {
-WASM-NEXT: Type: FUNCTION (0x3)
-WASM-NEXT: Size: 3
-WASM-NEXT: Offset: 130
-WASM-NEXT: }
-WASM-NEXT: Section {
-WASM-NEXT: Type: CODE (0xA)
-WASM-NEXT: Size: 36
-WASM-NEXT: Offset: 139
-WASM-NEXT: }
-WASM-NEXT: Section {
-WASM-NEXT: Type: DATA (0xB)
-WASM-NEXT: Size: 19
-WASM-NEXT: Offset: 181
-WASM-NEXT: Segments [
-WASM-NEXT: Segment {
-WASM-NEXT: Name: .rodata..L.str
-WASM-NEXT: Size: 13
-WASM-NEXT: Offset: 0
-WASM-NEXT: }
-WASM-NEXT: ]
-WASM-NEXT: }
-WASM-NEXT: Section {
-WASM-NEXT: Type: CUSTOM (0x0)
-WASM-NEXT: Size: 89
-WASM-NEXT: Offset: 206
-WASM-NEXT: Name: linking
-WASM-NEXT: }
-WASM-NEXT: Section {
-WASM-NEXT: Type: CUSTOM (0x0)
-WASM-NEXT: Size: 15
-WASM-NEXT: Offset: 309
-WASM-NEXT: Name: reloc.CODE
-WASM-NEXT: }
-WASM-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/symbols.test b/llvm/test/tools/llvm-readobj/symbols.test
deleted file mode 100644
index 55725850ed79..000000000000
--- a/llvm/test/tools/llvm-readobj/symbols.test
+++ /dev/null
@@ -1,129 +0,0 @@
-RUN: llvm-readobj --symbols %p/COFF/Inputs/trivial.obj.coff-i386 \
-RUN: | FileCheck %s -check-prefix COFF
-RUN: llvm-readobj --symbols %p/ELF/Inputs/trivial.obj.elf-i386 \
-RUN: | FileCheck %s -check-prefix ELF
-RUN: llvm-readobj --symbols %p/wasm/Inputs/trivial.obj.wasm \
-RUN: | FileCheck %s -check-prefix WASM
-
-# Check flag aliases produce identical output.
-RUN: llvm-readobj --symbols %p/ELF/Inputs/trivial.obj.elf-i386 > %t.symbols
-RUN: llvm-readobj --syms %p/ELF/Inputs/trivial.obj.elf-i386 > %t.syms
-RUN: cmp %t.symbols %t.syms
-RUN: llvm-readobj -t %p/ELF/Inputs/trivial.obj.elf-i386 > %t.t
-RUN: cmp %t.symbols %t.t
-RUN: llvm-readelf -s -elf-output-style LLVM %p/ELF/Inputs/trivial.obj.elf-i386 > %t.lowers
-RUN: cmp %t.symbols %t.lowers
-
-COFF: Symbols [
-COFF-NEXT: Symbol {
-COFF-NEXT: Name: @comp.id
-COFF-NEXT: Value: 14766605
-COFF-NEXT: Section: IMAGE_SYM_ABSOLUTE (-1)
-COFF-NEXT: BaseType: Null (0x0)
-COFF-NEXT: ComplexType: Null (0x0)
-COFF-NEXT: StorageClass: Static (0x3)
-COFF-NEXT: AuxSymbolCount: 0
-COFF-NEXT: }
-COFF-NEXT: Symbol {
-COFF-NEXT: Name: @feat.00
-COFF-NEXT: Value: 2147484049
-COFF-NEXT: Section: IMAGE_SYM_ABSOLUTE (-1)
-COFF-NEXT: BaseType: Null (0x0)
-COFF-NEXT: ComplexType: Null (0x0)
-COFF-NEXT: StorageClass: Static (0x3)
-COFF-NEXT: AuxSymbolCount: 0
-COFF-NEXT: }
-COFF-NEXT: Symbol {
-COFF-NEXT: Name: .text
-COFF-NEXT: Value: 0
-COFF-NEXT: Section: .text (1)
-COFF-NEXT: BaseType: Null (0x0)
-COFF-NEXT: ComplexType: Null (0x0)
-COFF-NEXT: StorageClass: Static (0x3)
-COFF-NEXT: AuxSymbolCount: 1
-COFF-NEXT: AuxSectionDef {
-COFF-NEXT: Length: 22
-COFF-NEXT: RelocationCount: 3
-COFF-NEXT: LineNumberCount: 0
-COFF-NEXT: Checksum: 0x0
-COFF-NEXT: Number: 1
-COFF-NEXT: Selection: 0x0
-COFF-NEXT: }
-COFF-NEXT: }
-
-ELF: Symbols [
-ELF-NEXT: Symbol {
-ELF-NEXT: Name: (0)
-ELF-NEXT: Value: 0x0
-ELF-NEXT: Size: 0
-ELF-NEXT: Binding: Local (0x0)
-ELF-NEXT: Type: None (0x0)
-ELF-NEXT: Other: 0
-ELF-NEXT: Section: Undefined (0x0)
-ELF-NEXT: }
-ELF-NEXT: Symbol {
-ELF-NEXT: Name: trivial.ll (1)
-ELF-NEXT: Value: 0x0
-ELF-NEXT: Size: 0
-ELF-NEXT: Binding: Local (0x0)
-ELF-NEXT: Type: File (0x4)
-ELF-NEXT: Other: 0
-ELF-NEXT: Section: Absolute (0xFFF1)
-ELF-NEXT: }
-ELF-NEXT: Symbol {
-ELF-NEXT: Name: .L.str (39)
-ELF-NEXT: Value: 0x0
-ELF-NEXT: Size: 13
-ELF-NEXT: Binding: Local (0x0)
-ELF-NEXT: Type: Object (0x1)
-ELF-NEXT: Other: 0
-ELF-NEXT: Section: .rodata.str1.1 (0x5)
-ELF-NEXT: }
-
-WASM: Symbols [
-WASM-NEXT: Symbol {
-WASM-NEXT: Name: main
-WASM-NEXT: Type: FUNCTION (0x0)
-WASM-NEXT: Flags [ (0x0)
-WASM-NEXT: ]
-WASM-NEXT: ElementIndex: 0x2
-WASM-NEXT: }
-WASM-NEXT: Symbol {
-WASM-NEXT: Name: .L.str
-WASM-NEXT: Type: DATA (0x1)
-WASM-NEXT: Flags [ (0x2)
-WASM-NEXT: BINDING_LOCAL (0x2)
-WASM-NEXT: ]
-WASM-NEXT: Offset: 0x0
-WASM-NEXT: Segment: 0x0
-WASM-NEXT: Size: 0xD
-WASM-NEXT: }
-WASM-NEXT: Symbol {
-WASM-NEXT: Name: puts
-WASM-NEXT: Type: FUNCTION (0x0)
-WASM-NEXT: Flags [ (0x10)
-WASM-NEXT: UNDEFINED (0x10)
-WASM-NEXT: ]
-WASM-NEXT: ImportName: puts
-WASM-NEXT: ImportModule: env
-WASM-NEXT: ElementIndex: 0x0
-WASM-NEXT: }
-WASM-NEXT: Symbol {
-WASM-NEXT: Name: .LSomeOtherFunction_bitcast
-WASM-NEXT: Type: FUNCTION (0x0)
-WASM-NEXT: Flags [ (0x2)
-WASM-NEXT: BINDING_LOCAL (0x2)
-WASM-NEXT: ]
-WASM-NEXT: ElementIndex: 0x3
-WASM-NEXT: }
-WASM-NEXT: Symbol {
-WASM-NEXT: Name: SomeOtherFunction
-WASM-NEXT: Type: FUNCTION (0x0)
-WASM-NEXT: Flags [ (0x10)
-WASM-NEXT: UNDEFINED (0x10)
-WASM-NEXT: ]
-WASM-NEXT: ImportName: SomeOtherFunction
-WASM-NEXT: ImportModule: env
-WASM-NEXT: ElementIndex: 0x1
-WASM-NEXT: }
-WASM-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/thin-archive.test b/llvm/test/tools/llvm-readobj/thin-archive.test
index 5a14d80cce64..f0c26bf914d5 100644
--- a/llvm/test/tools/llvm-readobj/thin-archive.test
+++ b/llvm/test/tools/llvm-readobj/thin-archive.test
@@ -1,12 +1,9 @@
# RUN: rm -f %t.a
# RUN: rm -rf %t
# RUN: mkdir -p %t
-
-# Make copies of the test inputs for placing in the archive so that we can mess
-# about with them later on.
-# RUN: cp %p/ELF/Inputs/trivial.obj.elf-x86-64 %t/1.o
-# RUN: cp %p/ELF/Inputs/relocs.obj.elf-x86_64 %t/2.o
-# RUN: cp %p/COFF/Inputs/trivial.obj.coff-arm %t/3.o
+# RUN: yaml2obj --docnum=1 %s -o %t/1.o
+# RUN: yaml2obj --docnum=2 %s -o %t/2.o
+# RUN: yaml2obj --docnum=3 %s -o %t/3.o
# RUN: llvm-ar rcT %t.a %t/1.o %t/2.o %t/3.o
# Test that basic dumping works for all members.
@@ -16,30 +13,26 @@
# LLVM: File: {{.*}}1.o
# LLVM: Format: ELF64-x86-64
# LLVM: ElfHeader {
-# LLVM: SectionHeaderCount: 10
+# LLVM: SectionHeaderCount: 3
# LLVM: Sections [
# LLVM: Relocations [
# LLVM: Symbols [
# GNU: ELF Header:
-# GNU: Number of section headers: 10
+# GNU: Number of section headers: 3
# GNU: Section Headers:
-# GNU: Relocation section '.rela.text'
-# GNU: Symbol table '.symtab'
# LLVM: File: {{.*}}2.o
-# LLVM: Format: ELF64-x86-64
+# LLVM: Format: ELF32-i386
# LLVM: ElfHeader {
-# LLVM: SectionHeaderCount: 8
+# LLVM: SectionHeaderCount: 4
# LLVM: Sections [
# LLVM: Relocations [
# LLVM: Symbols [
# GNU: ELF Header:
-# GNU: Number of section headers: 8
+# GNU: Number of section headers: 4
# GNU: Section Headers:
-# GNU: Relocation section '.rela.text'
-# GNU: Symbol table '.symtab'
# LLVM: File: {{.*}}3.o
# LLVM: Format: COFF-ARM
@@ -55,9 +48,9 @@
# RUN: llvm-readobj --file-headers %t.a | FileCheck %s --check-prefix=RESIZED
# RESIZED: File: {{.*}}1.o
-# RESIZED: SectionHeaderCount: 10
+# RESIZED: Format: ELF64-x86-64
# RESIZED: File: {{.*}}2.o
-# RESIZED: SectionHeaderCount: 10
+# RESIZED: Format: ELF64-x86-64
# Remove the second member and show that the first can still be dumped, but that the last isn't.
# RUN: rm %t/2.o
@@ -65,6 +58,30 @@
# RUN: FileCheck %s --check-prefix=ERR --input-file=%t.err
# MISSING: File: {{.*}}1.o
-# MISSING: SectionHeaderCount: 10
+# MISSING: Format: ELF64-x86-64
# MISSING-NOT: File: {{.*}}3.o
# ERR: error: '{{.*}}.a': '{{.*}}2.o': {{[Nn]}}o such file or directory
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_386
+Sections:
+ - Name: .foo
+ Type: SHT_PROGBITS
+
+--- !COFF
+header:
+ Machine: IMAGE_FILE_MACHINE_ARMNT
+ Characteristics: [ ]
+sections: []
+symbols: []
diff --git a/llvm/test/tools/llvm-readobj/wasm/hex-dump.test b/llvm/test/tools/llvm-readobj/wasm/hex-dump.test
new file mode 100644
index 000000000000..7a47b65e7a73
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/wasm/hex-dump.test
@@ -0,0 +1,8 @@
+## Test that --hex-dump/-x can be used to display the contents
+## of the indicated section as hexadecimal bytes.
+
+# RUN: llvm-readobj -x 1 %p/Inputs/trivial.obj.wasm | FileCheck %s
+# RUN: llvm-readobj --hex-dump 1 %p/Inputs/trivial.obj.wasm | FileCheck %s
+
+# CHECK: 0x00000000 04600001 7f60017f 017f6000 0060017f .`...`....`..`..
+# CHECK: 0x00000010 00 .
diff --git a/llvm/test/tools/llvm-readobj/wasm/relocations.test b/llvm/test/tools/llvm-readobj/wasm/relocations.test
new file mode 100644
index 000000000000..b2455938b34f
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/wasm/relocations.test
@@ -0,0 +1,30 @@
+## Check how we print relocations.
+
+# RUN: llvm-readobj -r --expand-relocs %p/Inputs/trivial.obj.wasm \
+# RUN: | FileCheck %s --check-prefix WASM
+
+# WASM: Relocations [
+# WASM-NEXT: Section (4) CODE {
+# WASM-NEXT: Relocation {
+# WASM-NEXT: Type: R_WASM_MEMORY_ADDR_SLEB (4)
+# WASM-NEXT: Offset: 0x4
+# WASM-NEXT: Symbol: .L.str
+# WASM-NEXT: Addend: 0
+# WASM-NEXT: }
+# WASM-NEXT: Relocation {
+# WASM-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
+# WASM-NEXT: Offset: 0xA
+# WASM-NEXT: Symbol: puts
+# WASM-NEXT: }
+# WASM-NEXT: Relocation {
+# WASM-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
+# WASM-NEXT: Offset: 0x11
+# WASM-NEXT: Symbol: .LSomeOtherFunction_bitcast
+# WASM-NEXT: }
+# WASM-NEXT: Relocation {
+# WASM-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
+# WASM-NEXT: Offset: 0x1E
+# WASM-NEXT: Symbol: SomeOtherFunction
+# WASM-NEXT: }
+# WASM-NEXT: }
+# WASM-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/wasm/sections.test b/llvm/test/tools/llvm-readobj/wasm/sections.test
new file mode 100644
index 000000000000..8b8a526295eb
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/wasm/sections.test
@@ -0,0 +1,50 @@
+## Check how we print sections.
+
+# RUN: llvm-readobj --sections %p/Inputs/trivial.obj.wasm | FileCheck %s
+
+# CHECK: Sections [
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Type: TYPE (0x1)
+# CHECK-NEXT: Size: 17
+# CHECK-NEXT: Offset: 8
+# CHECK-NEXT: }
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Type: IMPORT (0x2)
+# CHECK-NEXT: Size: 93
+# CHECK-NEXT: Offset: 31
+# CHECK-NEXT: }
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Type: FUNCTION (0x3)
+# CHECK-NEXT: Size: 3
+# CHECK-NEXT: Offset: 130
+# CHECK-NEXT: }
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Type: CODE (0xA)
+# CHECK-NEXT: Size: 36
+# CHECK-NEXT: Offset: 139
+# CHECK-NEXT: }
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Type: DATA (0xB)
+# CHECK-NEXT: Size: 19
+# CHECK-NEXT: Offset: 181
+# CHECK-NEXT: Segments [
+# CHECK-NEXT: Segment {
+# CHECK-NEXT: Name: .rodata..L.str
+# CHECK-NEXT: Size: 13
+# CHECK-NEXT: Offset: 0
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
+# CHECK-NEXT: }
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Type: CUSTOM (0x0)
+# CHECK-NEXT: Size: 89
+# CHECK-NEXT: Offset: 206
+# CHECK-NEXT: Name: linking
+# CHECK-NEXT: }
+# CHECK-NEXT: Section {
+# CHECK-NEXT: Type: CUSTOM (0x0)
+# CHECK-NEXT: Size: 15
+# CHECK-NEXT: Offset: 309
+# CHECK-NEXT: Name: reloc.CODE
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/wasm/symbols.test b/llvm/test/tools/llvm-readobj/wasm/symbols.test
new file mode 100644
index 000000000000..c55285344dba
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/wasm/symbols.test
@@ -0,0 +1,51 @@
+## This is the test for the --symbols option and its aliases.
+
+# RUN: llvm-readobj --symbols %p/Inputs/trivial.obj.wasm | FileCheck %s
+
+# CHECK: Symbols [
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: main
+# CHECK-NEXT: Type: FUNCTION (0x0)
+# CHECK-NEXT: Flags [ (0x0)
+# CHECK-NEXT: ]
+# CHECK-NEXT: ElementIndex: 0x2
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: .L.str
+# CHECK-NEXT: Type: DATA (0x1)
+# CHECK-NEXT: Flags [ (0x2)
+# CHECK-NEXT: BINDING_LOCAL (0x2)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Offset: 0x0
+# CHECK-NEXT: Segment: 0x0
+# CHECK-NEXT: Size: 0xD
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: puts
+# CHECK-NEXT: Type: FUNCTION (0x0)
+# CHECK-NEXT: Flags [ (0x10)
+# CHECK-NEXT: UNDEFINED (0x10)
+# CHECK-NEXT: ]
+# CHECK-NEXT: ImportName: puts
+# CHECK-NEXT: ImportModule: env
+# CHECK-NEXT: ElementIndex: 0x0
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: .LSomeOtherFunction_bitcast
+# CHECK-NEXT: Type: FUNCTION (0x0)
+# CHECK-NEXT: Flags [ (0x2)
+# CHECK-NEXT: BINDING_LOCAL (0x2)
+# CHECK-NEXT: ]
+# CHECK-NEXT: ElementIndex: 0x3
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: SomeOtherFunction
+# CHECK-NEXT: Type: FUNCTION (0x0)
+# CHECK-NEXT: Flags [ (0x10)
+# CHECK-NEXT: UNDEFINED (0x10)
+# CHECK-NEXT: ]
+# CHECK-NEXT: ImportName: SomeOtherFunction
+# CHECK-NEXT: ImportModule: env
+# CHECK-NEXT: ElementIndex: 0x1
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
More information about the llvm-commits
mailing list