brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.8 KiB · 4ac7fc7 Raw
116 lines · plain
1# RUN: echo -n AAAB > %t.diff2# RUN: echo -n AAA > %t.smaller3# RUN: echo -n AAAAAAAAA > %t.larger4 5# RUN: yaml2obj --docnum=1 %s -o %t6 7# RUN: llvm-objcopy --update-section __TEXT,__text=%t.diff %t - | obj2yaml | FileCheck %s8# CHECK: content: '41414142'9 10# RUN: llvm-objcopy --update-section __TEXT,__text=%t.smaller %t - | obj2yaml | FileCheck %s --check-prefix=SMALLER11# SMALLER: content: '414141'12 13# RUN: not llvm-objcopy --update-section __TEXT,__text=%t.larger %t /dev/null 2>&1 | FileCheck %s --check-prefix=TOO-LARGE14# TOO-LARGE: error: {{.*}}new section cannot be larger than previous section15 16# RUN: not llvm-objcopy --update-section __TEXT,__text=%t.noexist %t /dev/null17 18# RUN: not llvm-objcopy --update-section __NOEXIST,__text=%t.diff %t /dev/null 2>&1 | FileCheck %s --check-prefix=NO-SEGMENT19# NO-SEGMENT: error: {{.*}}could not find section with name '__text' in '__NOEXIST' segment20 21# RUN: not llvm-objcopy --update-section __TEXT,__noexist=%t.diff %t /dev/null 2>&1 | FileCheck %s --check-prefix=NO-SECTION22# NO-SECTION: error: {{.*}}could not find section with name '__noexist'23 24# RUN: yaml2obj --docnum=2 %s -o %t25 26# RUN: llvm-objcopy --update-section __TEXT,__text=%t.diff %t - | obj2yaml | FileCheck %s --check-prefix=FULL-SECNAME27# FULL-SECNAME: content: '41414142'28 29# RUN: not llvm-objcopy --update-section __text=%t.diff %t /dev/null 2>&1 | FileCheck %s --check-prefix=NON-CANONICAL-SECNAME30# NON-CANONICAL-SECNAME: error: {{.*}}invalid section name '__text' (should be formatted as '<segment name>,<section name>')31 32--- !mach-o33FileHeader:34  magic:           0xFEEDFACF35  cputype:         0x0100000736  cpusubtype:      0x0000000337  filetype:        0x0000000138  ncmds:           139  sizeofcmds:      15240  flags:           0x0000200041  reserved:        0x0000000042LoadCommands:43  - cmd:             LC_SEGMENT_6444    cmdsize:         15245    segname:         __TEXT46    vmaddr:          047    vmsize:          448    fileoff:         18449    filesize:        450    maxprot:         751    initprot:        752    nsects:          153    flags:           054    Sections:55      - sectname:        __text56        segname:         __TEXT57        addr:            0x000000000000000058        content:         '41414141'59        size:            460        offset:          18461        align:           062        reloff:          0x0000000063        nreloc:          064        flags:           0x8000040065        reserved1:       0x0000000066        reserved2:       0x0000000067        reserved3:       0x0000000068 69--- !mach-o70FileHeader:71  magic:           0xFEEDFACF72  cputype:         0x0100000773  cpusubtype:      0x0000000374  filetype:        0x0000000175  ncmds:           176  sizeofcmds:      31277  flags:           0x0000200078  reserved:        0x0000000079LoadCommands:80  - cmd:             LC_SEGMENT_6481    cmdsize:         31282    segname:         '__TEXT'83    vmaddr:          084    vmsize:          1285    fileoff:         34486    filesize:        1287    maxprot:         788    initprot:        789    nsects:          390    flags:           091    Sections:92      - sectname:        __text93        segname:         __TEXT94        addr:            0x000000000000000095        content:         'AABBCCDD'96        size:            497        offset:          34498        align:           099        reloff:          0x00000000100        nreloc:          0101        flags:           0x80000400102        reserved1:       0x00000000103        reserved2:       0x00000000104      - sectname:        __text105        segname:         __TEXT2106        addr:            0x0000000000000004107        content:         ''108        size:            0109        offset:          348110        align:           0111        reloff:          0x00000000112        nreloc:          0113        flags:           0x00000000114        reserved1:       0x00000000115        reserved2:       0x00000000116