1 # RUN: yaml2obj %s -o %t
3 ## Show which flags are preserved when setting other section flags.
4 # RUN: llvm-objcopy --set-section-flags=.foo=alloc %t %t.alloc
5 # RUN: llvm-readobj --sections %t.alloc | FileCheck %s --check-prefixes=CHECK,ALLOC,WRITE
6 # RUN: llvm-objcopy --set-section-flags=.foo=load %t %t.load
7 # RUN: llvm-readobj --sections %t.load | FileCheck %s --check-prefixes=CHECK,WRITE
8 # RUN: llvm-objcopy --set-section-flags=.foo=noload %t %t.noload
9 # RUN: llvm-readobj --sections %t.noload | FileCheck %s --check-prefixes=CHECK,WRITE
10 # RUN: llvm-objcopy --set-section-flags=.foo=readonly %t %t.readonly
11 # RUN: llvm-readobj --sections %t.readonly | FileCheck %s --check-prefixes=CHECK
12 # RUN: llvm-objcopy --set-section-flags=.foo=debug %t %t.debug
13 # RUN: llvm-readobj --sections %t.debug | FileCheck %s --check-prefixes=CHECK,WRITE
14 # RUN: llvm-objcopy --set-section-flags=.foo=code %t %t.code
15 # RUN: llvm-readobj --sections %t.code | FileCheck %s --check-prefixes=CHECK,EXEC,WRITE
16 # RUN: llvm-objcopy --set-section-flags=.foo=data %t %t.data
17 # RUN: llvm-readobj --sections %t.data | FileCheck %s --check-prefixes=CHECK,WRITE
18 # RUN: llvm-objcopy --set-section-flags=.foo=rom %t %t.rom
19 # RUN: llvm-readobj --sections %t.rom | FileCheck %s --check-prefixes=CHECK,WRITE
20 # RUN: llvm-objcopy --set-section-flags=.foo=contents %t %t.contents
21 # RUN: llvm-readobj --sections %t.contents | FileCheck %s --check-prefixes=CHECK,WRITE
22 # RUN: llvm-objcopy --set-section-flags=.foo=merge %t %t.merge
23 # RUN: llvm-readobj --sections %t.merge | FileCheck %s --check-prefixes=CHECK,MERGE,WRITE
24 # RUN: llvm-objcopy --set-section-flags=.foo=strings %t %t.strings
25 # RUN: llvm-readobj --sections %t.strings | FileCheck %s --check-prefixes=CHECK,STRINGS,WRITE
26 # RUN: llvm-objcopy --set-section-flags=.foo=share %t %t.share
27 # RUN: llvm-readobj --sections %t.share | FileCheck %s --check-prefixes=CHECK,WRITE
28 # RUN: llvm-objcopy --set-section-flags=.foo=exclude %t %t.exclude
29 # RUN: llvm-readobj --sections %t.exclude | FileCheck %s --check-prefixes=CHECK,WRITE,EXCLUDE
46 - SectionOrType: GRP_COMDAT
51 Flags: [ SHF_ALLOC, SHF_COMPRESSED, SHF_EXCLUDE, SHF_EXECINSTR,
52 SHF_GROUP, SHF_INFO_LINK, SHF_LINK_ORDER, SHF_MERGE,
53 SHF_OS_NONCONFORMING, SHF_STRINGS, SHF_TLS, SHF_WRITE ]
60 # CHECK-NEXT: Type: SHT_PROGBITS
62 # ALLOC-NEXT: SHF_ALLOC (0x2)
63 # CHECK-NEXT: SHF_COMPRESSED (0x800)
64 # EXCLUDE-NEXT: SHF_EXCLUDE (0x80000000)
65 # EXEC-NEXT: SHF_EXECINSTR (0x4)
66 # CHECK-NEXT: SHF_GROUP (0x200)
67 # CHECK-NEXT: SHF_INFO_LINK (0x40)
68 # CHECK-NEXT: SHF_LINK_ORDER (0x80)
69 # MERGE-NEXT: SHF_MERGE (0x10)
70 # STRINGS-NEXT: SHF_STRINGS (0x20)
71 # CHECK-NEXT: SHF_TLS (0x400)
72 # WRITE-NEXT: SHF_WRITE (0x1)