37 lines · yaml
1## This test ensures that LLVM will not crash when converting a Mach-O object2## file with a malformed symbol whose n_sect points to an invalid offset.3 4# RUN: yaml2obj %s -o %t5# RUN: not llvm-gsymutil --convert %t -o %t.o 2>&1 | FileCheck %s6 7# CHECK: Loaded 0 functions from symbol table.8 9--- !mach-o10FileHeader:11 magic: 0xFEEDFACF12 cputype: 0x0100000713 cpusubtype: 0x0000000314 filetype: 0x0000000A15 ncmds: 116 sizeofcmds: 10017 flags: 0x0000000018 reserved: 0x0000000019LoadCommands:20 - cmd: LC_SYMTAB21 cmdsize: 2422 symoff: 409623 nsyms: 124 stroff: 414425 strsize: 626LinkEditData:27 NameList:28 - n_strx: 2 # _foo29 n_type: 0x0e30 n_sect: 3 # Points to an invalid offset.31 n_desc: 032 n_value: 123433 StringTable:34 - ''35 - ''36 - _foo37