aboutsummaryrefslogtreecommitdiff
path: root/test/tools
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-18 18:08:55 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-18 18:08:55 +0000
commitfd7aa38e304a09fa0ef51b85b773b649b7e58c5e (patch)
treeb60cff57cb597e0d649f4d382bd8274cf7a90bd8 /test/tools
parent77327fd652e184c413744eabec8d9fdd605d09c1 (diff)
At Jim Grosbach's request detemplate Object/MachO.h.
We are still able to handle mixed endian objects by swapping one struct at a time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tools')
-rw-r--r--test/tools/llvm-readobj/Inputs/trivial.obj.macho-armbin0 -> 908 bytes
-rw-r--r--test/tools/llvm-readobj/relocations.test89
-rw-r--r--test/tools/llvm-readobj/sections-ext.test277
-rw-r--r--test/tools/llvm-readobj/sections.test121
4 files changed, 487 insertions, 0 deletions
diff --git a/test/tools/llvm-readobj/Inputs/trivial.obj.macho-arm b/test/tools/llvm-readobj/Inputs/trivial.obj.macho-arm
new file mode 100644
index 0000000000..117df9efc1
--- /dev/null
+++ b/test/tools/llvm-readobj/Inputs/trivial.obj.macho-arm
Binary files differ
diff --git a/test/tools/llvm-readobj/relocations.test b/test/tools/llvm-readobj/relocations.test
index 6dc08eeb06..c23a7fe5bb 100644
--- a/test/tools/llvm-readobj/relocations.test
+++ b/test/tools/llvm-readobj/relocations.test
@@ -10,6 +10,8 @@ RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-ppc \
RUN: | FileCheck %s -check-prefix MACHO-PPC
RUN: llvm-readobj -r %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
COFF: Relocations [
COFF-NEXT: Section (1) .text {
@@ -82,3 +84,90 @@ MACHO-PPC64-NEXT: Section __la_symbol_ptr {
MACHO-PPC64-NEXT: 0x0 0 3 1 0 dyld_stub_binding_helper
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: Extern: N/A
+MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
+MACHO-ARM-NEXT: Symbol: _b
+MACHO-ARM-NEXT: Scattered: 1
+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: Extern: N/A
+MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+MACHO-ARM-NEXT: Symbol: _b
+MACHO-ARM-NEXT: Scattered: 1
+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: Extern: 1
+MACHO-ARM-NEXT: Type: ARM_RELOC_BR24 (5)
+MACHO-ARM-NEXT: Symbol: _g
+MACHO-ARM-NEXT: Scattered: 0
+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: Extern: 1
+MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
+MACHO-ARM-NEXT: Symbol: _g
+MACHO-ARM-NEXT: Scattered: 0
+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: Extern: 0
+MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+MACHO-ARM-NEXT: Symbol: _b
+MACHO-ARM-NEXT: Scattered: 0
+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: Extern: 1
+MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
+MACHO-ARM-NEXT: Symbol: _g
+MACHO-ARM-NEXT: Scattered: 0
+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: Extern: 0
+MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+MACHO-ARM-NEXT: Symbol: _b
+MACHO-ARM-NEXT: Scattered: 0
+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: Extern: N/A
+MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
+MACHO-ARM-NEXT: Symbol: _b
+MACHO-ARM-NEXT: Scattered: 1
+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: Extern: N/A
+MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+MACHO-ARM-NEXT: Symbol: _b
+MACHO-ARM-NEXT: Scattered: 1
+MACHO-ARM-NEXT: }
+MACHO-ARM-NEXT: }
+MACHO-ARM-NEXT: ]
diff --git a/test/tools/llvm-readobj/sections-ext.test b/test/tools/llvm-readobj/sections-ext.test
index 3e42ab94fe..526ddfe82c 100644
--- a/test/tools/llvm-readobj/sections-ext.test
+++ b/test/tools/llvm-readobj/sections-ext.test
@@ -10,6 +10,8 @@ RUN: llvm-readobj -s -st -sr -sd %p/Inputs/trivial.obj.macho-ppc \
RUN: | FileCheck %s -check-prefix MACHO-PPC
RUN: llvm-readobj -s -st -sr -sd %p/Inputs/trivial.obj.macho-ppc64 \
RUN: | FileCheck %s -check-prefix MACHO-PPC64
+RUN: llvm-readobj -expand-relocs -s -st -sr -sd %p/Inputs/trivial.obj.macho-arm \
+RUN: | FileCheck %s -check-prefix MACHO-ARM
COFF: Sections [
COFF-NEXT: Section {
@@ -562,3 +564,278 @@ 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: 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: Extern: N/A
+MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
+MACHO-ARM-NEXT: Symbol: _b
+MACHO-ARM-NEXT: Scattered: 1
+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: Extern: N/A
+MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+MACHO-ARM-NEXT: Symbol: _b
+MACHO-ARM-NEXT: Scattered: 1
+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: Extern: 1
+MACHO-ARM-NEXT: Type: ARM_RELOC_BR24 (5)
+MACHO-ARM-NEXT: Symbol: _g
+MACHO-ARM-NEXT: Scattered: 0
+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: Extern: 1
+MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
+MACHO-ARM-NEXT: Symbol: _g
+MACHO-ARM-NEXT: Scattered: 0
+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: Extern: 0
+MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+MACHO-ARM-NEXT: Symbol: _b
+MACHO-ARM-NEXT: Scattered: 0
+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: Extern: 1
+MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
+MACHO-ARM-NEXT: Symbol: _g
+MACHO-ARM-NEXT: Scattered: 0
+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: Extern: 0
+MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+MACHO-ARM-NEXT: Symbol: _b
+MACHO-ARM-NEXT: Scattered: 0
+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: Extern: N/A
+MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
+MACHO-ARM-NEXT: Symbol: _b
+MACHO-ARM-NEXT: Scattered: 1
+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: Extern: N/A
+MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
+MACHO-ARM-NEXT: Symbol: _b
+MACHO-ARM-NEXT: Scattered: 1
+MACHO-ARM-NEXT: }
+MACHO-ARM-NEXT: ]
+MACHO-ARM-NEXT: Symbols [
+MACHO-ARM-NEXT: Symbol {
+MACHO-ARM-NEXT: Name: _f (4)
+MACHO-ARM-NEXT: Type: 0xF
+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: Type: 0xF
+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 |.@-..p........@.|
+MACHO-ARM-NEXT: 0020: F6FFFFEB 0C009FE5 00009FE7 000090E5 |................|
+MACHO-ARM-NEXT: 0030: 8040BDE8 1EFF2FE1 10000000 |.@..../.....|
+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: 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: 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: 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: 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: 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: Type: 0xF
+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: 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/test/tools/llvm-readobj/sections.test b/test/tools/llvm-readobj/sections.test
index b569682497..16f1131e05 100644
--- a/test/tools/llvm-readobj/sections.test
+++ b/test/tools/llvm-readobj/sections.test
@@ -10,6 +10,8 @@ RUN: llvm-readobj -s %p/Inputs/trivial.obj.macho-ppc \
RUN: | FileCheck %s -check-prefix MACHO-PPC
RUN: llvm-readobj -s %p/Inputs/trivial.obj.macho-ppc64 \
RUN: | FileCheck %s -check-prefix MACHO-PPC64
+RUN: llvm-readobj -s %p/Inputs/trivial.obj.macho-arm \
+RUN: | FileCheck %s -check-prefix MACHO-ARM
COFF: Sections [
COFF-NEXT: Section {
@@ -329,3 +331,122 @@ MACHO-PPC64-NEXT: Reserved1: 0x2
MACHO-PPC64-NEXT: Reserved2: 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: 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: 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: 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: 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: 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: 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: 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:]