brintos

brintos / llvm-project-archived public Read only

0
0
Text · 9.4 KiB · 45c3b0b Raw
344 lines · plain
1## Check that removing load commands updates the indexes of special LCs:2 3# RUN: yaml2obj %s -o %t4# RUN: llvm-install-name-tool -delete_rpath @executable_a/. %t5# RUN: llvm-objdump -p %t | FileCheck %s --check-prefix=INDEX6 7# INDEX:      Load command 38# INDEX-NEXT: cmd LC_DYLD_INFO_ONLY9# INDEX:      Load command 510# INDEX-NEXT: cmd LC_DATA_IN_CODE11# INDEX:      Load command 812# INDEX-NEXT: cmd LC_FUNCTION_STARTS13# INDEX:      Load command 1314# INDEX-NEXT: cmd LC_DYSYMTAB15# INDEX:      Load command 1416# INDEX-NEXT: cmd LC_SYMTAB17 18--- !mach-o19FileHeader:20  magic:           0xFEEDFACF21  cputype:         0x0100000722  cpusubtype:      0x8000000323  filetype:        0x0000000224  ncmds:           1625  sizeofcmds:      100826  flags:           0x0020008527  reserved:        0x0000000028LoadCommands:29  - cmd:             LC_SEGMENT_6430    cmdsize:         7231    segname:         __PAGEZERO32    vmaddr:          033    vmsize:          429496729634    fileoff:         035    filesize:        036    maxprot:         037    initprot:        038    nsects:          039    flags:           040  - cmd:             LC_SEGMENT_6441    cmdsize:         23242    segname:         __TEXT43    vmaddr:          429496729644    vmsize:          409645    fileoff:         046    filesize:        409647    maxprot:         748    initprot:        549    nsects:          250    flags:           051    Sections:52      - sectname:        __text53        segname:         __TEXT54        addr:            0x0000000100000F9055        size:            3656        offset:          0x00000F9057        align:           458        reloff:          0x0000000059        nreloc:          060        flags:           0x8000040061        reserved1:       0x0000000062        reserved2:       0x0000000063        reserved3:       0x0000000064      - sectname:        __unwind_info65        segname:         __TEXT66        addr:            0x0000000100000FB467        size:            7268        offset:          0x00000FB469        align:           270        reloff:          0x0000000071        nreloc:          072        flags:           0x0000000073        reserved1:       0x0000000074        reserved2:       0x0000000075        reserved3:       0x0000000076  - cmd:             LC_SEGMENT_6477    cmdsize:         23278    segname:         __DATA79    vmaddr:          429497139280    vmsize:          409681    fileoff:         409682    filesize:        409683    maxprot:         784    initprot:        385    nsects:          286    flags:           087    Sections:88      - sectname:        __data89        segname:         __DATA90        addr:            0x000000010000100091        size:            492        offset:          0x0000100093        align:           294        reloff:          0x0000000095        nreloc:          096        flags:           0x0000000097        reserved1:       0x0000000098        reserved2:       0x0000000099        reserved3:       0x00000000100      - sectname:        __common101        segname:         __DATA102        addr:            0x0000000100001004103        size:            4104        offset:          0x00000000105        align:           2106        reloff:          0x00000000107        nreloc:          0108        flags:           0x00000001109        reserved1:       0x00000000110        reserved2:       0x00000000111        reserved3:       0x00000000112  - cmd:             LC_RPATH113    cmdsize:         32114    path:            12115    Content:         '@executable_a/.'116  - cmd:             LC_DYLD_INFO_ONLY117    cmdsize:         48118    rebase_off:      0119    rebase_size:     0120    bind_off:        0121    bind_size:       0122    weak_bind_off:   0123    weak_bind_size:  0124    lazy_bind_off:   0125    lazy_bind_size:  0126    export_off:      8192127    export_size:     56128  - cmd:             LC_SEGMENT_64129    cmdsize:         72130    segname:         __LINKEDIT131    vmaddr:          4294975488132    vmsize:          4096133    fileoff:         8192134    filesize:        496135    maxprot:         7136    initprot:        1137    nsects:          0138    flags:           0139  - cmd:             LC_DATA_IN_CODE140    cmdsize:         16141    dataoff:         8256142    datasize:        8143  - cmd:             LC_LOAD_DYLINKER144    cmdsize:         32145    name:            12146    Content:         '/usr/lib/dyld'147    ZeroPadBytes:    7148  - cmd:             LC_UUID149    cmdsize:         24150    uuid:            56D84164-1DA8-393B-8589-BC4C6B56168E151  - cmd:             LC_FUNCTION_STARTS152    cmdsize:         16153    dataoff:         8248154    datasize:        8155  - cmd:             LC_BUILD_VERSION156    cmdsize:         32157    platform:        1158    minos:           658944159    sdk:             658944160    ntools:          1161    Tools:162      - tool:            3163        version:         29491968164  - cmd:             LC_SOURCE_VERSION165    cmdsize:         16166    version:         0167  - cmd:             LC_MAIN168    cmdsize:         24169    entryoff:        3984170    stacksize:       0171  - cmd:             LC_LOAD_DYLIB172    cmdsize:         56173    dylib:174      name:            24175      timestamp:       2176      current_version: 82115073177      compatibility_version: 65536178    Content:         '/usr/lib/libSystem.B.dylib'179    ZeroPadBytes:    6180  - cmd:             LC_DYSYMTAB181    cmdsize:         80182    ilocalsym:       0183    nlocalsym:       11184    iextdefsym:      11185    nextdefsym:      3186    iundefsym:       14187    nundefsym:       1188    tocoff:          0189    ntoc:            0190    modtaboff:       0191    nmodtab:         0192    extrefsymoff:    0193    nextrefsyms:     0194    indirectsymoff:  8264195    nindirectsyms:   0196    extreloff:       0197    nextrel:         0198    locreloff:       0199    nlocrel:         0200  - cmd:             LC_SYMTAB201    cmdsize:         24202    symoff:          8264203    nsyms:           15204    stroff:          8504205    strsize:         192206LinkEditData:207  ExportTrie:208    TerminalSize:    0209    NodeOffset:      0210    Name:            ''211    Flags:           0x0000000000000000212    Address:         0x0000000000000000213    Other:           0x0000000000000000214    ImportName:      ''215    Children:216      - TerminalSize:    0217        NodeOffset:      5218        Name:            _219        Flags:           0x0000000000000000220        Address:         0x0000000000000000221        Other:           0x0000000000000000222        ImportName:      ''223        Children:224          - TerminalSize:    2225            NodeOffset:      38226            Name:            _mh_execute_header227            Flags:           0x0000000000000000228            Address:         0x0000000000000000229            Other:           0x0000000000000000230            ImportName:      ''231          - TerminalSize:    3232            NodeOffset:      42233            Name:            main234            Flags:           0x0000000000000000235            Address:         0x0000000000000F90236            Other:           0x0000000000000000237            ImportName:      ''238          - TerminalSize:    3239            NodeOffset:      47240            Name:            foo241            Flags:           0x0000000000000000242            Address:         0x0000000000001004243            Other:           0x0000000000000000244            ImportName:      ''245  NameList:246    - n_strx:          50247      n_type:          0x64248      n_sect:          0249      n_desc:          0250      n_value:         0251    - n_strx:          92252      n_type:          0x64253      n_sect:          0254      n_desc:          0255      n_value:         0256    - n_strx:          100257      n_type:          0x66258      n_sect:          3259      n_desc:          1260      n_value:         1564714240261    - n_strx:          1262      n_type:          0x2E263      n_sect:          1264      n_desc:          0265      n_value:         4294971280266    - n_strx:          164267      n_type:          0x24268      n_sect:          1269      n_desc:          0270      n_value:         4294971280271    - n_strx:          1272      n_type:          0x24273      n_sect:          0274      n_desc:          0275      n_value:         36276    - n_strx:          1277      n_type:          0x4E278      n_sect:          1279      n_desc:          0280      n_value:         36281    - n_strx:          170282      n_type:          0x26283      n_sect:          3284      n_desc:          0285      n_value:         4294971392286    ## A local undefined SymDebugTable entry followed by287    - n_strx:          175288      n_type:          0x20289      n_sect:          0290      n_desc:          0291      n_value:         0292    ## a defined SymDebugTable entry.293    - n_strx:          1294      n_type:          0x64295      n_sect:          1296      n_desc:          0297      n_value:         0298    - n_strx:          180299      n_type:          0x0E300      n_sect:          3301      n_desc:          0302      n_value:         4294971392303    - n_strx:          2304      n_type:          0x0F305      n_sect:          1306      n_desc:          16307      n_value:         4294967296308    - n_strx:          22309      n_type:          0x0F310      n_sect:          4311      n_desc:          0312      n_value:         4294971396313    - n_strx:          27314      n_type:          0x0F315      n_sect:          1316      n_desc:          0317      n_value:         4294971280318    - n_strx:          33319      n_type:          0x01320      n_sect:          0321      n_desc:          256322      n_value:         0323  StringTable:324    - ' '325    - __mh_execute_header326    - _foo327    - _main328    - dyld_stub_binder329    - '/Users/anonymous/llvm-project/llvm/build/'330    - strip.c331    - '/var/folders/g7/l0p5czpd2jz6w0gswg6cwgjc0000gn/T/strip-95c4bf.o'332    - _main333    - _bar334    - _foo335    - _bar336    - ''337    - ''338    - ''339    - ''340    - ''341    - ''342    - ''343...344