xref: /llvm-project/llvm/test/tools/llvm-readobj/ELF/machine-specific-section-types.test (revision 31f4b329c8234fab9afa59494d7f8bdaeaefeaad)
1# Show that all machine-specific section types are properly printed for both LLVM and
2# GNU styles for ELF files with that machine type.
3
4# RUN: yaml2obj %s --docnum=1 -o %t-arm.o
5# RUN: llvm-readobj --section-headers %t-arm.o | FileCheck %s --check-prefix=ARM-LLVM
6# RUN: llvm-readelf --section-headers %t-arm.o | FileCheck %s --check-prefix=ARM-GNU
7
8# RUN: yaml2obj %s --docnum=2 -o %t-x86_64.o
9# RUN: llvm-readobj --section-headers %t-x86_64.o | FileCheck %s --check-prefix=X86-LLVM
10# RUN: llvm-readelf --section-headers %t-x86_64.o | FileCheck %s --check-prefix=X86-GNU
11
12# RUN: yaml2obj %s --docnum=3 -o %t-mips.o
13# RUN: llvm-readobj --section-headers %t-mips.o | FileCheck %s --check-prefix=MIPS-LLVM
14# RUN: llvm-readelf --section-headers %t-mips.o | FileCheck %s --check-prefix=MIPS-GNU
15
16# RUN: yaml2obj %s --docnum=4 -o %t-aarch64.o
17# RUN: llvm-readobj --section-headers %t-aarch64.o | FileCheck %s --check-prefix=AARCH64-LLVM
18# RUN: llvm-readelf --section-headers %t-aarch64.o | FileCheck %s --check-prefix=AARCH64-GNU
19
20# RUN: yaml2obj %s --docnum=5 -o %t-hexagon.o
21# RUN: llvm-readobj --section-headers %t-hexagon.o | FileCheck %s --check-prefix=HEXAGON-LLVM
22# RUN: llvm-readelf --section-headers %t-hexagon.o | FileCheck %s --check-prefix=HEXAGON-GNU
23
24# ARM-LLVM: Name: exidx
25# ARM-LLVM: Type: SHT_ARM_EXIDX
26# ARM-LLVM: Name: preemptmap
27# ARM-LLVM: Type: SHT_ARM_PREEMPTMAP
28# ARM-LLVM: Name: attributes
29# ARM-LLVM: Type: SHT_ARM_ATTRIBUTES
30# ARM-LLVM: Name: debugoverlay
31# ARM-LLVM: Type: SHT_ARM_DEBUGOVERLAY
32# ARM-LLVM: Name: overlaysection
33# ARM-LLVM: Type: SHT_ARM_OVERLAYSECTION
34
35# ARM-GNU: exidx          ARM_EXIDX
36# ARM-GNU: preemptmap     ARM_PREEMPTMAP
37# ARM-GNU: attributes     ARM_ATTRIBUTES
38# ARM-GNU: debugoverlay   ARM_DEBUGOVERLAY
39# ARM-GNU: overlaysection ARM_OVERLAYSECTION
40
41# X86-LLVM: Name: unwind
42# X86-LLVM: Type: SHT_X86_64_UNWIND
43
44# X86-GNU: unwind X86_64_UNWIND
45
46# MIPS-LLVM: Name: reginfo
47# MIPS-LLVM: Type: SHT_MIPS_REGINFO
48# MIPS-LLVM: Name: options
49# MIPS-LLVM: Type: SHT_MIPS_OPTIONS
50# MIPS-LLVM: Name: abiflags
51# MIPS-LLVM: Type: SHT_MIPS_ABIFLAGS
52# MIPS-LLVM: Name: dwarf
53# MIPS-LLVM: Type: SHT_MIPS_DWARF
54
55# MIPS-GNU: reginfo  MIPS_REGINFO
56# MIPS-GNU: options  MIPS_OPTIONS
57# MIPS-GNU: abiflags MIPS_ABIFLAGS
58# MIPS-GNU: dwarf    MIPS_DWARF
59
60# AARCH64-LLVM: Name: aarch64_auth_relr
61# AARCH64-LLVM: Type: SHT_AARCH64_AUTH_RELR
62# AARCH64-LLVM: Name: .memtag.globals.dynamic
63# AARCH64-LLVM: Type: SHT_AARCH64_MEMTAG_GLOBALS_DYNAMIC
64# AARCH64-LLVM: Name: .memtag.globals.static
65# AARCH64-LLVM: Type: SHT_AARCH64_MEMTAG_GLOBALS_STATIC
66
67# AARCH64-GNU: aarch64_auth_relr       AARCH64_AUTH_RELR
68# AARCH64-GNU: .memtag.globals.dynamic AARCH64_MEMTAG_GLOBALS_DYNAMIC
69# AARCH64-GNU: .memtag.globals.static  AARCH64_MEMTAG_GLOBALS_STATIC
70
71# HEXAGON-LLVM: Name: hexagon_ordered
72# HEXAGON-LLVM: Type: SHT_HEX_ORDERED
73# HEXAGON-LLVM: Name: .hexagon.attributes
74# HEXAGON-LLVM: Type: SHT_HEXAGON_ATTRIBUTES
75
76# HEXAGON-GNU: hexagon_ordered HEX_ORDERED
77
78--- !ELF
79FileHeader:
80  Class:   ELFCLASS64
81  Data:    ELFDATA2LSB
82  Type:    ET_REL
83  Machine: EM_ARM
84Sections:
85  - Name: exidx
86    Type: SHT_ARM_EXIDX
87  - Name: preemptmap
88    Type: SHT_ARM_PREEMPTMAP
89  - Name: attributes
90    Type: SHT_ARM_ATTRIBUTES
91  - Name: debugoverlay
92    Type: SHT_ARM_DEBUGOVERLAY
93  - Name: overlaysection
94    Type: SHT_ARM_OVERLAYSECTION
95
96--- !ELF
97FileHeader:
98  Class:   ELFCLASS64
99  Data:    ELFDATA2LSB
100  Type:    ET_REL
101  Machine: EM_X86_64
102Sections:
103  - Name: unwind
104    Type: SHT_X86_64_UNWIND
105
106--- !ELF
107FileHeader:
108  Class:   ELFCLASS64
109  Data:    ELFDATA2LSB
110  Type:    ET_REL
111  Machine: EM_MIPS
112Sections:
113  - Name: reginfo
114    Type: SHT_MIPS_REGINFO
115  - Name: options
116    Type: SHT_MIPS_OPTIONS
117  - Name: abiflags
118    Type: SHT_MIPS_ABIFLAGS
119    ISA:  MIPS64
120  - Name: dwarf
121    Type: SHT_MIPS_DWARF
122
123--- !ELF
124FileHeader:
125  Class:   ELFCLASS64
126  Data:    ELFDATA2LSB
127  Type:    ET_REL
128  Machine: EM_AARCH64
129Sections:
130  - Name: aarch64_auth_relr
131    Type: SHT_AARCH64_AUTH_RELR
132  - Name:  .memtag.globals.dynamic
133    Type:  SHT_AARCH64_MEMTAG_GLOBALS_DYNAMIC
134  - Name:  .memtag.globals.static
135    Type:  SHT_AARCH64_MEMTAG_GLOBALS_STATIC
136
137--- !ELF
138FileHeader:
139  Class:   ELFCLASS32
140  Data:    ELFDATA2LSB
141  Type:    ET_REL
142  Machine: EM_HEXAGON
143Sections:
144  - Name: hexagon_ordered
145    Type: SHT_HEX_ORDERED
146  - Name: .hexagon.attributes
147    Type: SHT_HEXAGON_ATTRIBUTES
148