234 lines · yaml
1## Verify that llvm-readobj can dump files with stabs symbols in a sorted order.2 3# RUN: yaml2obj --docnum=1 %s -o %t4 5# RUN: not llvm-readobj --syms --sort-symbols=foo %t 2>&1 | FileCheck %s --check-prefix ERR-KEY6# RUN: not llvm-readobj --syms --sort-symbols=,, %t 2>&1 | FileCheck %s --check-prefix ERR-KEY-EMPT7 8# RUN: llvm-readobj --syms --sort-symbols=type,name %t | FileCheck %s --check-prefix TYPE-NAME9# RUN: llvm-readobj --syms --sort-symbols=name,type %t | FileCheck %s --check-prefix NAME-TYPE10# RUN: llvm-readobj --syms --sort-symbols=type %t | FileCheck %s --check-prefix TYPE-ONLY11 12# ERR-KEY: error: --sort-symbols value should be 'name' or 'type', but was 'foo'13# ERR-KEY-EMPT: error: --sort-symbols value should be 'name' or 'type', but was ''14 15# TYPE-NAME: Name: _a (19)16# TYPE-NAME-NEXT: Type: Section (0xE)17# TYPE-NAME: Name: _d (10)18# TYPE-NAME-NEXT: Type: Section (0xE)19# TYPE-NAME: Name: _f (7)20# TYPE-NAME-NEXT: Type: SymDebugTable (0x2E)21# TYPE-NAME: Name: _z (1)22# TYPE-NAME-NEXT: Type: SymDebugTable (0x2E)23# TYPE-NAME: Name: _c (13)24# TYPE-NAME-NEXT: Type: SymDebugTable (0x64)25# TYPE-NAME: Name: _g (4)26# TYPE-NAME-NEXT: Type: SymDebugTable (0x64)27# TYPE-NAME: Name: _b (16)28# TYPE-NAME-NEXT: Type: SymDebugTable (0x66)29# TYPE-NAME: Name: _d2 (22)30# TYPE-NAME-NEXT: Type: SymDebugTable (0x66)31 32# NAME-TYPE: Name: _a (19)33# NAME-TYPE-NEXT: Type: Section (0xE)34# NAME-TYPE: Name: _b (16)35# NAME-TYPE-NEXT: Type: SymDebugTable (0x66)36# NAME-TYPE: Name: _c (13)37# NAME-TYPE-NEXT: Type: SymDebugTable (0x64)38# NAME-TYPE: Name: _d (10)39# NAME-TYPE-NEXT: Type: Section (0xE)40# NAME-TYPE: Name: _d2 (22)41# NAME-TYPE-NEXT: Type: SymDebugTable (0x66)42# NAME-TYPE: Name: _f (7)43# NAME-TYPE-NEXT: Type: SymDebugTable (0x2E)44# NAME-TYPE: Name: _g (4)45# NAME-TYPE-NEXT: Type: SymDebugTable (0x64)46# NAME-TYPE: Name: _z (1)47# NAME-TYPE-NEXT: Type: SymDebugTable (0x2E)48 49# TYPE-ONLY: Name: _d (10)50# TYPE-ONLY-NEXT: Type: Section (0xE)51# TYPE-ONLY: Name: _a (19)52# TYPE-ONLY-NEXT: Type: Section (0xE)53# TYPE-ONLY: Name: _f (7)54# TYPE-ONLY-NEXT: Type: SymDebugTable (0x2E)55# TYPE-ONLY: Name: _z (1)56# TYPE-ONLY-NEXT: Type: SymDebugTable (0x2E)57# TYPE-ONLY: Name: _g (4)58# TYPE-ONLY-NEXT: Type: SymDebugTable (0x64)59# TYPE-ONLY: Name: _c (13)60# TYPE-ONLY-NEXT: Type: SymDebugTable (0x64)61# TYPE-ONLY: Name: _d2 (22)62# TYPE-ONLY-NEXT: Type: SymDebugTable (0x66)63# TYPE-ONLY: Name: _b (16)64# TYPE-ONLY-NEXT: Type: SymDebugTable (0x66)65 66--- !mach-o67FileHeader:68 magic: 0xFEEDFACF69 cputype: 0x100000770 cpusubtype: 0x371 filetype: 0x172 ncmds: 373 sizeofcmds: 49674 flags: 0x200075 reserved: 0x076LoadCommands:77 - cmd: LC_SEGMENT_6478 cmdsize: 39279 segname: ''80 vmaddr: 081 vmsize: 3282 fileoff: 52883 filesize: 2884 maxprot: 785 initprot: 786 nsects: 487 flags: 088 Sections:89 - sectname: __text90 segname: __TEXT91 addr: 0x092 size: 993 offset: 0x21094 align: 095 reloff: 0x23096 nreloc: 197 flags: 0x8000000098 reserved1: 0x099 reserved2: 0x0100 reserved3: 0x0101 content: '000000000000000000'102 relocations:103 - address: 0x0104 symbolnum: 7105 pcrel: false106 length: 3107 extern: true108 type: 0109 scattered: false110 value: 0111 - sectname: more_data112 segname: __DATA113 addr: 0x9114 size: 8115 offset: 0x219116 align: 0117 reloff: 0x0118 nreloc: 0119 flags: 0x0120 reserved1: 0x0121 reserved2: 0x0122 reserved3: 0x0123 content: 7B00000000000000124 - sectname: __data125 segname: __DATA126 addr: 0x11127 size: 11128 offset: 0x221129 align: 0130 reloff: 0x0131 nreloc: 0132 flags: 0x0133 reserved1: 0x0134 reserved2: 0x0135 reserved3: 0x0136 content: 7B00000000000000000000137 - sectname: __common138 segname: __DATA139 addr: 0x1C140 size: 4141 offset: 0x0142 align: 2143 reloff: 0x0144 nreloc: 0145 flags: 0x1146 reserved1: 0x0147 reserved2: 0x0148 reserved3: 0x0149 - cmd: LC_SYMTAB150 cmdsize: 24151 symoff: 568152 nsyms: 8153 stroff: 696154 strsize: 32155 - cmd: LC_DYSYMTAB156 cmdsize: 80157 ilocalsym: 0158 nlocalsym: 7159 iextdefsym: 7160 nextdefsym: 0161 iundefsym: 7162 nundefsym: 1163 tocoff: 0164 ntoc: 0165 modtaboff: 0166 nmodtab: 0167 extrefsymoff: 0168 nextrefsyms: 0169 indirectsymoff: 0170 nindirectsyms: 0171 extreloff: 0172 nextrel: 0173 locreloff: 0174 nlocrel: 0175LinkEditData:176 NameList:177 - n_strx: 4178 n_type: 0x64179 n_sect: 1180 n_desc: 0181 n_value: 0182 - n_strx: 10183 n_type: 0xE184 n_sect: 1185 n_desc: 0186 n_value: 8187 - n_strx: 22188 n_type: 0x66189 n_sect: 1190 n_desc: 0191 n_value: 8192 - n_strx: 16193 n_type: 0x66194 n_sect: 2195 n_desc: 0196 n_value: 9197 - n_strx: 19198 n_type: 0xE199 n_sect: 3200 n_desc: 0201 n_value: 17202 - n_strx: 13203 n_type: 0x64204 n_sect: 4205 n_desc: 0206 n_value: 28207 - n_strx: 7208 n_type: 0x2E209 n_sect: 3210 n_desc: 0211 n_value: 25212 - n_strx: 1213 n_type: 0x2E214 n_sect: 0215 n_desc: 0216 n_value: 0217 StringTable:218 - ''219 - _z220 - _g221 - _f222 - _d223 - _c224 - _b225 - _a226 - _d2227 - ''228 - ''229 - ''230 - ''231 - ''232 - ''233...234