1 # RUN: yaml2obj %s -o %t
3 ## Test that llvm-objcopy can add sections and set its flags in the same
5 # RUN: echo DEADBEEF > %t.sec
6 # RUN: llvm-objcopy --set-section-flags=.test.section1=code --add-section=.test.section1=%t.sec --set-section-flags=.test.section2=data --add-section=.test.section2=%t.sec %t %t1
7 # RUN: llvm-readobj --sections --section-data %t1 | FileCheck %s
9 # CHECK: Name: .test.section1
10 # CHECK-NEXT: VirtualSize: 0x9
11 # CHECK-NEXT: VirtualAddress: 0x0
12 # CHECK-NEXT: RawDataSize: 9
13 # CHECK: Characteristics [
14 # CHECK-NEXT: IMAGE_SCN_CNT_CODE
15 # CHECK-NEXT: IMAGE_SCN_MEM_EXECUTE
16 # CHECK-NEXT: IMAGE_SCN_MEM_READ
17 # CHECK-NEXT: IMAGE_SCN_MEM_WRITE
20 # CHECK: Name: .test.section2
21 # CHECK-NEXT: VirtualSize: 0x9
22 # CHECK-NEXT: VirtualAddress: 0x9
23 # CHECK-NEXT: RawDataSize: 9
24 # CHECK: Characteristics [
25 # CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
26 # CHECK-NEXT: IMAGE_SCN_MEM_READ
27 # CHECK-NEXT: IMAGE_SCN_MEM_WRITE
32 Machine: IMAGE_FILE_MACHINE_AMD64