1 ## Here we test how OS and processor specific flags are dumped.
3 # RUN: yaml2obj %s -o %t.o
4 # RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=OS-PROC-LLVM %s
5 # RUN: llvm-readelf -S %t.o | FileCheck --check-prefix=OS-PROC-GNU %s
7 # OS-PROC-LLVM: Name: .os.flags.low
8 # OS-PROC-LLVM-NEXT: Type: SHT_PROGBITS
9 # OS-PROC-LLVM-NEXT: Flags [ (0x100000)
10 # OS-PROC-LLVM-NEXT: ]
11 # OS-PROC-LLVM: Name: .os.flags.high
12 # OS-PROC-LLVM-NEXT: Type: SHT_PROGBITS
13 # OS-PROC-LLVM-NEXT: Flags [ (0xFE00000)
14 # OS-PROC-LLVM-NEXT: SHF_GNU_RETAIN (0x200000)
15 # OS-PROC-LLVM-NEXT: ]
16 # OS-PROC-LLVM: Name: .os.flags.mask
17 # OS-PROC-LLVM-NEXT: Type: SHT_PROGBITS
18 # OS-PROC-LLVM-NEXT: Flags [ (0xFF00000)
19 # OS-PROC-LLVM-NEXT: SHF_GNU_RETAIN (0x200000)
20 # OS-PROC-LLVM-NEXT: ]
21 # OS-PROC-LLVM: Name: .proc.flags.low
22 # OS-PROC-LLVM-NEXT: Type: SHT_PROGBITS
23 # OS-PROC-LLVM-NEXT: Flags [ (0x10000000)
24 # OS-PROC-LLVM-NEXT: ]
25 # OS-PROC-LLVM: Name: .proc.flags.high
26 # OS-PROC-LLVM-NEXT: Type: SHT_PROGBITS
27 # OS-PROC-LLVM-NEXT: Flags [ (0xE0000000)
28 # OS-PROC-LLVM-NEXT: SHF_EXCLUDE (0x80000000)
29 # OS-PROC-LLVM-NEXT: ]
30 # OS-PROC-LLVM: Name: .proc.flags.mask
31 # OS-PROC-LLVM-NEXT: Type: SHT_PROGBITS
32 # OS-PROC-LLVM-NEXT: Flags [ (0xF0000000)
33 # OS-PROC-LLVM-NEXT: SHF_EXCLUDE (0x80000000)
34 # OS-PROC-LLVM-NEXT: ]
35 # OS-PROC-LLVM: Name: .both.flags.low
36 # OS-PROC-LLVM-NEXT: Type: SHT_PROGBITS
37 # OS-PROC-LLVM-NEXT: Flags [ (0x10100000)
38 # OS-PROC-LLVM-NEXT: ]
39 # OS-PROC-LLVM: Name: .both.flags.high
40 # OS-PROC-LLVM-NEXT: Type: SHT_PROGBITS
41 # OS-PROC-LLVM-NEXT: Flags [ (0xEFE00000)
42 # OS-PROC-LLVM-NEXT: SHF_EXCLUDE (0x80000000)
43 # OS-PROC-LLVM-NEXT: SHF_GNU_RETAIN (0x200000)
44 # OS-PROC-LLVM-NEXT: ]
45 # OS-PROC-LLVM: Name: .both.flags.mask
46 # OS-PROC-LLVM-NEXT: Type: SHT_PROGBITS
47 # OS-PROC-LLVM-NEXT: Flags [ (0xFFF00000)
48 # OS-PROC-LLVM-NEXT: SHF_EXCLUDE (0x80000000)
49 # OS-PROC-LLVM-NEXT: SHF_GNU_RETAIN (0x200000)
50 # OS-PROC-LLVM-NEXT: ]
51 # OS-PROC-LLVM: Name: .exclude
52 # OS-PROC-LLVM-NEXT: Type: SHT_PROGBITS
53 # OS-PROC-LLVM-NEXT: Flags [ (0x80000000)
54 # OS-PROC-LLVM-NEXT: SHF_EXCLUDE (0x80000000)
55 # OS-PROC-LLVM-NEXT: ]
56 # OS-PROC-LLVM: Name: .all.possible
57 # OS-PROC-LLVM-NEXT: Type: SHT_PROGBITS
58 # OS-PROC-LLVM-NEXT: Flags [ (0xFFFFFFFF)
59 # OS-PROC-LLVM-NEXT: SHF_ALLOC (0x2)
60 # OS-PROC-LLVM-NEXT: SHF_COMPRESSED (0x800)
61 # OS-PROC-LLVM-NEXT: SHF_EXCLUDE (0x80000000)
62 # OS-PROC-LLVM-NEXT: SHF_EXECINSTR (0x4)
63 # OS-PROC-LLVM-NEXT: SHF_GNU_RETAIN (0x200000)
64 # OS-PROC-LLVM-NEXT: SHF_GROUP (0x200)
65 # OS-PROC-LLVM-NEXT: SHF_INFO_LINK (0x40)
66 # OS-PROC-LLVM-NEXT: SHF_LINK_ORDER (0x80)
67 # OS-PROC-LLVM-NEXT: SHF_MERGE (0x10)
68 # OS-PROC-LLVM-NEXT: SHF_OS_NONCONFORMING (0x100)
69 # OS-PROC-LLVM-NEXT: SHF_STRINGS (0x20)
70 # OS-PROC-LLVM-NEXT: SHF_TLS (0x400)
71 # OS-PROC-LLVM-NEXT: SHF_WRITE (0x1)
72 # OS-PROC-LLVM-NEXT: ]
74 # OS-PROC-GNU: Section Headers:
75 # OS-PROC-GNU-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
76 # OS-PROC-GNU-NEXT: [ 0] NULL 0000000000000000 000000 000000 00 0 0 0
77 # OS-PROC-GNU-NEXT: [ 1] .os.flags.low PROGBITS 0000000000000000 000040 000000 00 o 0 0 0
78 # OS-PROC-GNU-NEXT: [ 2] .os.flags.high PROGBITS 0000000000000000 000040 000000 00 Ro 0 0 0
79 # OS-PROC-GNU-NEXT: [ 3] .os.flags.mask PROGBITS 0000000000000000 000040 000000 00 o 0 0 0
80 # OS-PROC-GNU-NEXT: [ 4] .proc.flags.low PROGBITS 0000000000000000 000040 000000 00 p 0 0 0
81 # OS-PROC-GNU-NEXT: [ 5] .proc.flags.high PROGBITS 0000000000000000 000040 000000 00 p 0 0 0
82 # OS-PROC-GNU-NEXT: [ 6] .proc.flags.mask PROGBITS 0000000000000000 000040 000000 00 p 0 0 0
83 # OS-PROC-GNU-NEXT: [ 7] .both.flags.low PROGBITS 0000000000000000 000040 000000 00 op 0 0 0
84 # OS-PROC-GNU-NEXT: [ 8] .both.flags.high PROGBITS 0000000000000000 000040 000000 00 Rop 0 0 0
85 # OS-PROC-GNU-NEXT: [ 9] .both.flags.mask PROGBITS 0000000000000000 000040 000000 00 op 0 0 0
86 # OS-PROC-GNU-NEXT: [10] .exclude PROGBITS 0000000000000000 000040 000000 00 E 0 0 0
87 # OS-PROC-GNU-NEXT: [11] .all.possible PROGBITS 0000000000000000 000040 000000 00 WAXMSILOGTCopx 0 0 0
89 ## Use an arbitrary EM_* machine type that does not have specific SHF_* OS/Processor
90 ## flags to test what we dump when bits in the OS and processor specific ranges are set.
101 - Name: .os.flags.high
104 - Name: .os.flags.mask
107 - Name: .proc.flags.low
110 - Name: .proc.flags.high
113 - Name: .proc.flags.mask
116 - Name: .both.flags.low
119 - Name: .both.flags.high
122 - Name: .both.flags.mask
125 ## SHF_MASKPROC has a value of 0xf0000000, SHF_EXCLUDE has a value of
126 ## 0x80000000. When SHF_EXCLUDE is mixed with other processor specific
127 ## flags, GNU readelf does not necessarily print "E", because it handles
128 ## the SHF_MASKPROC mask first. It only prints "E" when there are no other
129 ## processor flags set. Check llvm-readelf output matches GNU.
133 ## Set all possible flags to test where we print 'o' and 'p' letters.
134 - Name: .all.possible