brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 2e4b471 Raw
130 lines · yaml
1## Verify that llvm-readobj can dump files containing stabs symbols,2## particularly symbols of type N_OSO which have repurposed the n_sect field3## to store a non-section-index value.4 5# RUN: yaml2obj %s -o %t6# RUN: llvm-readobj --syms %t | FileCheck %s7 8# CHECK:      Symbols [9# CHECK-NEXT:   Symbol {10# CHECK-NEXT:     Name: /Volumes/Sandbox/ (2)11# CHECK-NEXT:     Type: SymDebugTable (0x64)12# CHECK-NEXT:     Section:  (0x0)13# CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)14# CHECK-NEXT:     Flags [ (0x0)15# CHECK-NEXT:     ]16# CHECK-NEXT:     Value: 0x017# CHECK-NEXT:   }18# CHECK-NEXT:   Symbol {19# CHECK-NEXT:     Name: /Volumes/Sandbox/test.o (20)20# CHECK-NEXT:     Type: SymDebugTable (0x66)21# CHECK-NEXT:     Section:  (0x3)22# CHECK-NEXT:     RefType: ReferenceFlagUndefinedLazy (0x1)23# CHECK-NEXT:     Flags [ (0x0)24# CHECK-NEXT:     ]25# CHECK-NEXT:     Value: 0x5F72D5E226# CHECK-NEXT:   }27# CHECK-NEXT:   Symbol {28# CHECK-NEXT:     Name:  (1)29# CHECK-NEXT:     Type: SymDebugTable (0x2E)30# CHECK-NEXT:     Section:  (0x1)31# CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)32# CHECK-NEXT:     Flags [ (0x0)33# CHECK-NEXT:     ]34# CHECK-NEXT:     Value: 0x100000FA035# CHECK-NEXT:   }36# CHECK-NEXT:   Symbol {37# CHECK-NEXT:     Name: _foo (44)38# CHECK-NEXT:     Type: SymDebugTable (0x24)39# CHECK-NEXT:     Section:  (0x1)40# CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)41# CHECK-NEXT:     Flags [ (0x0)42# CHECK-NEXT:     ]43# CHECK-NEXT:     Value: 0x100000FA044# CHECK-NEXT:   }45# CHECK-NEXT:   Symbol {46# CHECK-NEXT:     Name:  (1)47# CHECK-NEXT:     Type: SymDebugTable (0x4E)48# CHECK-NEXT:     Section:  (0x1)49# CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)50# CHECK-NEXT:     Flags [ (0x0)51# CHECK-NEXT:     ]52# CHECK-NEXT:     Value: 0xF53# CHECK-NEXT:   }54# CHECK-NEXT: ]55 56--- !mach-o57FileHeader:58  magic:           0xFEEDFACF59  cputype:         0x0100000760  cpusubtype:      0x0000000361  filetype:        0x0000000262  ncmds:           263  sizeofcmds:      74464  flags:           0x0020008565  reserved:        0x0000000066LoadCommands:67  - cmd:             LC_SEGMENT_6468    cmdsize:         23269    segname:         __TEXT70    vmaddr:          429496729671    vmsize:          409672    fileoff:         073    filesize:        409674    maxprot:         575    initprot:        576    nsects:          177    flags:           078    Sections:79      - sectname:        __text80        segname:         __TEXT81        addr:            0x0000000082        size:            083        offset:          0x0000000084        align:           485        reloff:          0x0000000086        nreloc:          087        flags:           0x8000040088        reserved1:       0x0000000089        reserved2:       0x0000000090        reserved3:       0x0000000091  - cmd:             LC_SYMTAB92    cmdsize:         2493    symoff:          415294    nsyms:           595    stroff:          432896    strsize:         4997LinkEditData:98  NameList:99    - n_strx:          2100      n_type:          0x64 ## N_SO101      n_sect:          0102      n_desc:          0103      n_value:         0104    - n_strx:          20105      n_type:          0x66 ## N_OSO106      n_sect:          3107      n_desc:          1108      n_value:         1601361378109    - n_strx:          1110      n_type:          0x2E ## N_BNSYM111      n_sect:          1112      n_desc:          0113      n_value:         4294971296114    - n_strx:          44115      n_type:          0x24 ## N_FUN116      n_sect:          1117      n_desc:          0118      n_value:         4294971296119    - n_strx:          1120      n_type:          0x4E ## N_ENSYM121      n_sect:          1122      n_desc:          0123      n_value:         15124  StringTable:125    - ' '126    - '/Volumes/Sandbox/'127    - '/Volumes/Sandbox/test.o'128    - _foo129...130