override-shflags.yaml
2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
## Check we are able to set custom sh_flags field
## for different sections.
# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: llvm-readobj --sections %t1 | FileCheck %s --check-prefix=UPDATE-FLAGS
# UPDATE-FLAGS: Name: .symtab
# UPDATE-FLAGS-NEXT: Type: SHT_SYMTAB
# UPDATE-FLAGS-NEXT: Flags [ (0x1)
# UPDATE-FLAGS: Name: .strtab
# UPDATE-FLAGS-NEXT: Type: SHT_STRTAB
# UPDATE-FLAGS-NEXT: Flags [ (0x2)
# UPDATE-FLAGS: Name: .shstrtab
# UPDATE-FLAGS-NEXT: Type: SHT_STRTAB
# UPDATE-FLAGS-NEXT: Flags [ (0x3)
# UPDATE-FLAGS: Name: .dynsym
# UPDATE-FLAGS-NEXT: Type: SHT_DYNSYM
# UPDATE-FLAGS-NEXT: Flags [ (0x4)
# UPDATE-FLAGS: Name: .dynstr
# UPDATE-FLAGS-NEXT: Type: SHT_STRTAB
# UPDATE-FLAGS-NEXT: Flags [ (0x5)
# UPDATE-FLAGS: Name: .regular.os
# UPDATE-FLAGS-NEXT: Type: SHT_PROGBITS
# UPDATE-FLAGS-NEXT: Flags [ (0xAB00000)
# UPDATE-FLAGS: Name: .regular.proc
# UPDATE-FLAGS-NEXT: Type: SHT_PROGBITS
# UPDATE-FLAGS-NEXT: Flags [ (0xC0000000)
# UPDATE-FLAGS: Name: .regular.all
# UPDATE-FLAGS-NEXT: Type: SHT_PROGBITS
# UPDATE-FLAGS-NEXT: Flags [ (0xFFFFFFFF)
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
## Check we can override flags for implicit sections.
- Name: .symtab
Type: SHT_SYMTAB
ShFlags: 0x000000001
- Name: .strtab
Type: SHT_STRTAB
ShFlags: 0x000000002
- Name: .shstrtab
Type: SHT_STRTAB
ShFlags: 0x000000003
- Name: .dynsym
Type: SHT_DYNSYM
ShFlags: 0x000000004
- Name: .dynstr
Type: SHT_STRTAB
ShFlags: 0x000000005
## Check we can override flags for regular sections.
- Name: .regular.os
Type: SHT_PROGBITS
ShFlags: 0x0AB00000
- Name: .regular.proc
Type: SHT_PROGBITS
ShFlags: 0xC0000000
- Name: .regular.all
Type: SHT_PROGBITS
ShFlags: 0xFFFFFFFF
## ShFlags is used when we want to work around the flag values validation.
## It does not make sense to allow both ShFlags and Flags in the document.
# RUN: not yaml2obj --docnum=2 %s 2>&1 | FileCheck %s --check-prefix=ERR
# ERR: error: ShFlags and Flags cannot be used together
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .symtab
Type: SHT_SYMTAB
Flags: [ SHF_ALLOC ]
ShFlags: 0x1