63 lines · plain
1# RUN: yaml2obj %s -o %t2 3## Verify that section is dumped before it is removed.4# RUN: llvm-objcopy --dump-section __TEXT,__text=%t1.dump --remove-section __TEXT,__text %t %t15# RUN: FileCheck %s --input-file=%t1.dump --check-prefix=CONTENTS --implicit-check-not={{.}}6 7# CONTENTS: abcd8 9## Verify that the newly added section is not dumped.10# RUN: echo CAFE > %t2.txt11# RUN: not llvm-objcopy --dump-section __TEXT,__const=%t2.dump --add-section __TEXT,__const=%t2.txt %t %t2 2>&1 | \12# RUN: FileCheck %s --check-prefix=NODUMP -DINPUT=%t13 14# NODUMP: error: '[[INPUT]]': section '__TEXT,__const' not found15 16--- !mach-o17FileHeader:18 magic: 0xFEEDFACF19 cputype: 0x0100000720 cpusubtype: 0x0000000321 filetype: 0x0000000122 ncmds: 123 sizeofcmds: 31224 flags: 0x0000200025 reserved: 0x0000000026LoadCommands:27 - cmd: LC_SEGMENT_6428 cmdsize: 31229 segname: ''30 vmaddr: 031 vmsize: 1232 fileoff: 34433 filesize: 1234 maxprot: 735 initprot: 736 nsects: 337 flags: 038 Sections:39 - sectname: __text40 segname: __TEXT41 addr: 0x000000000000000042 content: '61626364'43 size: 444 offset: 34445 align: 046 reloff: 0x0000000047 nreloc: 048 flags: 0x8000040049 reserved1: 0x0000000050 reserved2: 0x0000000051 - sectname: __data52 segname: __DATA53 addr: 0x000000000000000454 content: 'EEFFEEFF'55 size: 456 offset: 34857 align: 058 reloff: 0x0000000059 nreloc: 060 flags: 0x0000000061 reserved1: 0x0000000062 reserved2: 0x0000000063