1 # RUN: echo -n AAAB > %t.diff
2 # RUN: echo -n AAA > %t.smaller
3 # RUN: echo -n AAAAAAAAA > %t.larger
5 # RUN: yaml2obj --docnum=1 %s -o %t
7 # RUN: llvm-objcopy --update-section __TEXT,__text=%t.diff %t - | obj2yaml | FileCheck %s
8 # CHECK: content: '41414142'
10 # RUN: llvm-objcopy --update-section __TEXT,__text=%t.smaller %t - | obj2yaml | FileCheck %s --check-prefix=SMALLER
11 # SMALLER: content: '414141'
13 # RUN: not llvm-objcopy --update-section __TEXT,__text=%t.larger %t /dev/null 2>&1 | FileCheck %s --check-prefix=TOO-LARGE
14 # TOO-LARGE: error: {{.*}}new section cannot be larger than previous section
16 # RUN: not llvm-objcopy --update-section __TEXT,__text=%t.noexist %t /dev/null
18 # RUN: not llvm-objcopy --update-section __NOEXIST,__text=%t.diff %t /dev/null 2>&1 | FileCheck %s --check-prefix=NO-SEGMENT
19 # NO-SEGMENT: error: {{.*}}could not find segment with name '__NOEXIST'
21 # RUN: not llvm-objcopy --update-section __TEXT,__noexist=%t.diff %t /dev/null 2>&1 | FileCheck %s --check-prefix=NO-SECTION
22 # NO-SECTION: error: {{.*}}could not find section with name '__noexist'
24 # RUN: yaml2obj --docnum=2 %s -o %t
26 # RUN: llvm-objcopy --update-section __TEXT,__text=%t.diff %t - | obj2yaml | FileCheck %s --check-prefix=FULL-SECNAME
27 # FULL-SECNAME: content: '41414142'
29 # RUN: not llvm-objcopy --update-section __text=%t.diff %t /dev/null 2>&1 | FileCheck %s --check-prefix=NON-CANONICAL-SECNAME
30 # NON-CANONICAL-SECNAME: error: {{.*}}invalid section name '__text' (should be formatted as '<segment name>,<section name>')
36 cpusubtype: 0x00000003
57 addr: 0x0000000000000000
73 cpusubtype: 0x00000003
94 addr: 0x0000000000000000
102 reserved1: 0x00000000
103 reserved2: 0x00000000
106 addr: 0x0000000000000004
114 reserved1: 0x00000000
115 reserved2: 0x00000000