diff test/MC/MachO/ARM/darwin-Thumb-reloc.s @ 95:afa8332a0e37 LLVM3.8

LLVM 3.8
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Tue, 13 Oct 2015 17:48:58 +0900
parents 95c75e76d11b
children c2174574ed3a
line wrap: on
line diff
--- a/test/MC/MachO/ARM/darwin-Thumb-reloc.s	Wed Feb 18 14:56:07 2015 +0900
+++ b/test/MC/MachO/ARM/darwin-Thumb-reloc.s	Tue Oct 13 17:48:58 2015 +0900
@@ -1,5 +1,5 @@
 @ RUN: llvm-mc -n -triple thumbv7-apple-darwin10 %s -filetype=obj -o %t.obj
-@ RUN: macho-dump --dump-section-data < %t.obj > %t.dump
+@ RUN: llvm-readobj -file-headers -s -sd -r -t -macho-segment -macho-dysymtab -macho-indirect-symbols < %t.obj > %t.dump
 @ RUN: FileCheck < %t.dump %s
 
 	.syntax unified
@@ -22,118 +22,127 @@
 
 .subsections_via_symbols
 
-@ CHECK: ('cputype', 12)
-@ CHECK: ('cpusubtype', 9)
-@ CHECK: ('filetype', 1)
-@ CHECK: ('num_load_commands', 3)
-@ CHECK: ('load_commands_size', 296)
-@ CHECK: ('flag', 8192)
-@ CHECK: ('load_commands', [
-@ CHECK:   # Load Command 0
-@ CHECK:  (('command', 1)
-@ CHECK:   ('size', 192)
-@ CHECK:   ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-@ CHECK:   ('vm_addr', 0)
-@ CHECK:   ('vm_size', 11)
-@ CHECK:   ('file_offset', 324)
-@ CHECK:   ('file_size', 11)
-@ CHECK:   ('maxprot', 7)
-@ CHECK:   ('initprot', 7)
-@ CHECK:   ('num_sections', 2)
-@ CHECK:   ('flags', 0)
-@ CHECK:   ('sections', [
-@ CHECK:     # Section 0
-@ CHECK:    (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-@ CHECK:     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-@ CHECK:     ('address', 0)
-@ CHECK:     ('size', 8)
-@ CHECK:     ('offset', 324)
-@ CHECK:     ('alignment', 2)
-@ CHECK:     ('reloc_offset', 336)
-@ CHECK:     ('num_reloc', 3)
-@ CHECK:     ('flags', 0x80000400)
-@ CHECK:     ('reserved1', 0)
-@ CHECK:     ('reserved2', 0)
-@ CHECK:    ),
-@ CHECK:   ('_relocations', [
-@ CHECK:     # Relocation 0
-@ CHECK:     (('word-0', 0xa2000004),
-@ CHECK:      ('word-1', 0x8)),
-@ CHECK:     # Relocation 1
-@ CHECK:     (('word-0', 0xa1000000),
-@ CHECK:      ('word-1', 0x0)),
-@ CHECK:     # Relocation 2
-@ CHECK:     (('word-0', 0x0),
-@ CHECK:      ('word-1', 0x6d000001)),
-@ CHECK:   ])
-@ CHECK-FIXME:   ('_section_data', 'fff7feef 04000000')
-@ CHECK:     # Section 1
-@ CHECK:    (('section_name', '__cstring\x00\x00\x00\x00\x00\x00\x00')
-@ CHECK:     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-@ CHECK:     ('address', 8)
-@ CHECK:     ('size', 3)
-@ CHECK:     ('offset', 332)
-@ CHECK:     ('alignment', 2)
-@ CHECK:     ('reloc_offset', 0)
-@ CHECK:     ('num_reloc', 0)
-@ CHECK:     ('flags', 0x2)
-@ CHECK:     ('reserved1', 0)
-@ CHECK:     ('reserved2', 0)
-@ CHECK:    ),
-@ CHECK:   ('_relocations', [
-@ CHECK:   ])
-@ CHECK:   ('_section_data', '733000')
-@ CHECK:   ])
-@ CHECK:  ),
-@ CHECK:   # Load Command 1
-@ CHECK:  (('command', 2)
-@ CHECK:   ('size', 24)
-@ CHECK:   ('symoff', 360)
-@ CHECK:   ('nsyms', 2)
-@ CHECK:   ('stroff', 384)
-@ CHECK:   ('strsize', 16)
-@ CHECK:   ('_string_data', '\x00_main\x00_printf\x00\x00')
-@ CHECK:   ('_symbols', [
-@ CHECK:     # Symbol 0
-@ CHECK:    (('n_strx', 1)
-@ CHECK:     ('n_type', 0xf)
-@ CHECK:     ('n_sect', 1)
-@ CHECK:     ('n_desc', 8)
-@ CHECK:     ('n_value', 0)
-@ CHECK:     ('_string', '_main')
-@ CHECK:    ),
-@ CHECK:     # Symbol 1
-@ CHECK:    (('n_strx', 7)
-@ CHECK:     ('n_type', 0x1)
-@ CHECK:     ('n_sect', 0)
-@ CHECK:     ('n_desc', 0)
-@ CHECK:     ('n_value', 0)
-@ CHECK:     ('_string', '_printf')
-@ CHECK:    ),
-@ CHECK:   ])
-@ CHECK:  ),
-@ CHECK:   # Load Command 2
-@ CHECK:  (('command', 11)
-@ CHECK:   ('size', 80)
-@ CHECK:   ('ilocalsym', 0)
-@ CHECK:   ('nlocalsym', 0)
-@ CHECK:   ('iextdefsym', 0)
-@ CHECK:   ('nextdefsym', 1)
-@ CHECK:   ('iundefsym', 1)
-@ CHECK:   ('nundefsym', 1)
-@ CHECK:   ('tocoff', 0)
-@ CHECK:   ('ntoc', 0)
-@ CHECK:   ('modtaboff', 0)
-@ CHECK:   ('nmodtab', 0)
-@ CHECK:   ('extrefsymoff', 0)
-@ CHECK:   ('nextrefsyms', 0)
-@ CHECK:   ('indirectsymoff', 0)
-@ CHECK:   ('nindirectsyms', 0)
-@ CHECK:   ('extreloff', 0)
-@ CHECK:   ('nextrel', 0)
-@ CHECK:   ('locreloff', 0)
-@ CHECK:   ('nlocrel', 0)
-@ CHECK:   ('_indirect_symbols', [
-@ CHECK:   ])
-@ CHECK:  ),
-@ CHECK: ])
+@ CHECK: File: <stdin>
+@ CHECK: Format: Mach-O arm
+@ CHECK: Arch: arm
+@ CHECK: AddressSize: 32bit
+@ CHECK: MachHeader {
+@ CHECK:   Magic: Magic (0xFEEDFACE)
+@ CHECK:   CpuType: Arm (0xC)
+@ CHECK:   CpuSubType: CPU_SUBTYPE_ARM_V7 (0x9)
+@ CHECK:   FileType: Relocatable (0x1)
+@ CHECK:   NumOfLoadCommands: 4
+@ CHECK:   SizeOfLoadCommands: 312
+@ CHECK:   Flags [ (0x2000)
+@ CHECK:     MH_SUBSECTIONS_VIA_SYMBOLS (0x2000)
+@ CHECK:   ]
+@ CHECK: }
+@ CHECK: Sections [
+@ CHECK:   Section {
+@ CHECK:     Index: 0
+@ CHECK:     Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+@ CHECK:     Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+@ CHECK:     Address: 0x0
+@ CHECK:     Size: 0x8
+@ CHECK:     Offset: 340
+@ CHECK:     Alignment: 2
+@ CHECK:     RelocationOffset: 0x160
+@ CHECK:     RelocationCount: 3
+@ CHECK:     Type: 0x0
+@ CHECK:     Attributes [ (0x800004)
+@ CHECK:       PureInstructions (0x800000)
+@ CHECK:       SomeInstructions (0x4)
+@ CHECK:     ]
+@ CHECK:     Reserved1: 0x0
+@ CHECK:     Reserved2: 0x0
+@ CHECK:     SectionData (
+@ CHECK:       0000: FFF7FEEF 04000000                    |........|
+@ CHECK:     )
+@ CHECK:   }
+@ CHECK:   Section {
+@ CHECK:     Index: 1
+@ CHECK:     Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
+@ CHECK:     Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+@ CHECK:     Address: 0x8
+@ CHECK:     Size: 0x3
+@ CHECK:     Offset: 348
+@ CHECK:     Alignment: 2
+@ CHECK:     RelocationOffset: 0x0
+@ CHECK:     RelocationCount: 0
+@ CHECK:     Type: ExtReloc (0x2)
+@ CHECK:     Attributes [ (0x0)
+@ CHECK:     ]
+@ CHECK:     Reserved1: 0x0
+@ CHECK:     Reserved2: 0x0
+@ CHECK:     SectionData (
+@ CHECK:       0000: 733000                               |s0.|
+@ CHECK:     )
+@ CHECK:   }
+@ CHECK: ]
+@ CHECK: Relocations [
+@ CHECK:   Section __text {
+@ CHECK:     0x4 0 2 n/a ARM_RELOC_SECTDIFF 1 0x8
+@ CHECK:     0x0 0 2 n/a ARM_RELOC_PAIR 1 0x0
+@ CHECK:     0x0 1 2 1 ARM_THUMB_RELOC_BR22 0 _printf
+@ CHECK:   }
+@ CHECK: ]
+@ CHECK: Symbols [
+@ CHECK:   Symbol {
+@ CHECK:     Name: _main (1)
+@ CHECK:     Extern
+@ CHECK:     Type: Section (0xE)
+@ CHECK:     Section: __text (0x1)
+@ CHECK:     RefType: 0x8
+@ CHECK:     Flags [ (0x0)
+@ CHECK:     ]
+@ CHECK:     Value: 0x0
+@ CHECK:   }
+@ CHECK:   Symbol {
+@ CHECK:     Name: _printf (7)
+@ CHECK:     Extern
+@ CHECK:     Type: Undef (0x0)
+@ CHECK:     Section:  (0x0)
+@ CHECK:     RefType: UndefinedNonLazy (0x0)
+@ CHECK:     Flags [ (0x0)
+@ CHECK:     ]
+@ CHECK:     Value: 0x0
+@ CHECK:   }
+@ CHECK: ]
+@ CHECK: Indirect Symbols {
+@ CHECK:   Number: 0
+@ CHECK:   Symbols [
+@ CHECK:   ]
+@ CHECK: }
+@ CHECK: Segment {
+@ CHECK:   Cmd: LC_SEGMENT
+@ CHECK:   Name: 
+@ CHECK:   Size: 192
+@ CHECK:   vmaddr: 0x0
+@ CHECK:   vmsize: 0xB
+@ CHECK:   fileoff: 340
+@ CHECK:   filesize: 11
+@ CHECK:   maxprot: rwx
+@ CHECK:   initprot: rwx
+@ CHECK:   nsects: 2
+@ CHECK:   flags: 0x0
+@ CHECK: }
+@ CHECK: Dysymtab {
+@ CHECK:   ilocalsym: 0
+@ CHECK:   nlocalsym: 0
+@ CHECK:   iextdefsym: 0
+@ CHECK:   nextdefsym: 1
+@ CHECK:   iundefsym: 1
+@ CHECK:   nundefsym: 1
+@ CHECK:   tocoff: 0
+@ CHECK:   ntoc: 0
+@ CHECK:   modtaboff: 0
+@ CHECK:   nmodtab: 0
+@ CHECK:   extrefsymoff: 0
+@ CHECK:   nextrefsyms: 0
+@ CHECK:   indirectsymoff: 0
+@ CHECK:   nindirectsyms: 0
+@ CHECK:   extreloff: 0
+@ CHECK:   nextrel: 0
+@ CHECK:   locreloff: 0
+@ CHECK:   nlocrel: 0
+@ CHECK: }