llvm.org GIT mirror llvm / b2b56ed
[Mips] Support SHT_MIPS_ABIFLAGS section type flag in the llvm-readobj, obj2yaml and yaml2obj tools. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212908 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Atanasyan 6 years ago
16 changed file(s) with 66 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
343343 case ELF::EM_MIPS:
344344 ECase(SHT_MIPS_REGINFO)
345345 ECase(SHT_MIPS_OPTIONS)
346 ECase(SHT_MIPS_ABIFLAGS)
346347 default:
347348 // Nothing to do.
348349 break;
1010 # CHECK-OBJ: Section {
1111 # CHECK-OBJ: Index: 5
1212 # CHECK-OBJ: Name: .MIPS.abiflags (12)
13 # CHECK-OBJ: Type: (0x7000002A)
13 # CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
1414 # CHECK-OBJ: Flags [ (0x2)
1515 # CHECK-OBJ: SHF_ALLOC (0x2)
1616 # CHECK-OBJ: ]
1111 # CHECK-OBJ: Section {
1212 # CHECK-OBJ: Index: 5
1313 # CHECK-OBJ: Name: .MIPS.abiflags (12)
14 # CHECK-OBJ: Type: (0x7000002A)
14 # CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
1515 # CHECK-OBJ: Flags [ (0x2)
1616 # CHECK-OBJ: SHF_ALLOC (0x2)
1717 # CHECK-OBJ: ]
1010 # CHECK-OBJ: Section {
1111 # CHECK-OBJ: Index: 5
1212 # CHECK-OBJ: Name: .MIPS.abiflags (12)
13 # CHECK-OBJ: Type: (0x7000002A)
13 # CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
1414 # CHECK-OBJ: Flags [ (0x2)
1515 # CHECK-OBJ: SHF_ALLOC (0x2)
1616 # CHECK-OBJ: ]
1010 # CHECK-OBJ: Section {
1111 # CHECK-OBJ: Index: 5
1212 # CHECK-OBJ: Name: .MIPS.abiflags (12)
13 # CHECK-OBJ: Type: (0x7000002A)
13 # CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
1414 # CHECK-OBJ: Flags [ (0x2)
1515 # CHECK-OBJ: SHF_ALLOC (0x2)
1616 # CHECK-OBJ: ]
1010 # CHECK-OBJ: Section {
1111 # CHECK-OBJ: Index: 5
1212 # CHECK-OBJ: Name: .MIPS.abiflags (12)
13 # CHECK-OBJ: Type: (0x7000002A)
13 # CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
1414 # CHECK-OBJ: Flags [ (0x2)
1515 # CHECK-OBJ: SHF_ALLOC (0x2)
1616 # CHECK-OBJ: ]
1111 # CHECK-OBJ: Section {
1212 # CHECK-OBJ: Index: 5
1313 # CHECK-OBJ: Name: .MIPS.abiflags (12)
14 # CHECK-OBJ: Type: (0x7000002A)
14 # CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
1515 # CHECK-OBJ: Flags [ (0x2)
1616 # CHECK-OBJ: SHF_ALLOC (0x2)
1717 # CHECK-OBJ: ]
1111 # CHECK-OBJ: Section {
1212 # CHECK-OBJ: Index: 5
1313 # CHECK-OBJ: Name: .MIPS.abiflags (12)
14 # CHECK-OBJ: Type: (0x7000002A)
14 # CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
1515 # CHECK-OBJ: Flags [ (0x2)
1616 # CHECK-OBJ: SHF_ALLOC (0x2)
1717 # CHECK-OBJ: ]
1616 # CHECK-OBJ: Section {
1717 # CHECK-OBJ: Index: 5
1818 # CHECK-OBJ: Name: .MIPS.abiflags (12)
19 # CHECK-OBJ: Type: (0x7000002A)
19 # CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
2020 # CHECK-OBJ: Flags [ (0x2)
2121 # CHECK-OBJ: SHF_ALLOC (0x2)
2222 # CHECK-OBJ: ]
1616 # CHECK-OBJ: Section {
1717 # CHECK-OBJ: Index: 5
1818 # CHECK-OBJ: Name: .MIPS.abiflags (12)
19 # CHECK-OBJ: Type: (0x7000002A)
19 # CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
2020 # CHECK-OBJ: Flags [ (0x2)
2121 # CHECK-OBJ: SHF_ALLOC (0x2)
2222 # CHECK-OBJ: ]
2424 # CHECK-OBJ-ALL: Section {
2525 # CHECK-OBJ-ALL: Index: 5
2626 # CHECK-OBJ-ALL: Name: .MIPS.abiflags ({{[0-9]+}})
27 # CHECK-OBJ-ALL: Type: (0x7000002A)
27 # CHECK-OBJ-ALL: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
2828 # CHECK-OBJ-ALL: Flags [ (0x2)
2929 # CHECK-OBJ-ALL: SHF_ALLOC (0x2)
3030 # CHECK-OBJ-ALL: ]
190190 ELF-MIPSEL: FileHeader:
191191 ELF-MIPSEL-NEXT: Class: ELFCLASS32
192192 ELF-MIPSEL-NEXT: Data: ELFDATA2LSB
193 ELF-MIPSEL-NEXT: OSABI: ELFOSABI_GNU
193194 ELF-MIPSEL-NEXT: Type: ET_REL
194195 ELF-MIPSEL-NEXT: Machine: EM_MIPS
195196 ELF-MIPSEL-NEXT: Flags: [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
205206 ELF-MIPSEL-NEXT: AddressAlign: 0x0000000000000004
206207 ELF-MIPSEL-NEXT: Info: .text
207208 ELF-MIPSEL-NEXT: Relocations:
208 ELF-MIPSEL-NEXT: - Offset: 0
209 ELF-MIPSEL-NEXT: - Offset: 0x0000000000000000
209210 ELF-MIPSEL-NEXT: Symbol: _gp_disp
210211 ELF-MIPSEL-NEXT: Type: R_MIPS_HI16
211212 ELF-MIPSEL-NEXT: Addend: 0
238239 ELF-MIPSEL-NEXT: Type: SHT_NOBITS
239240 ELF-MIPSEL-NEXT: Flags: [ SHF_WRITE, SHF_ALLOC ]
240241 ELF-MIPSEL-NEXT: AddressAlign: 0x0000000000000004
242 ELF-MIPSEL-NEXT: Content: 48656C6C
243 ELF-MIPSEL-NEXT: - Name: .mdebug.abi32
244 ELF-MIPSEL-NEXT: Type: SHT_PROGBITS
245 ELF-MIPSEL-NEXT: AddressAlign: 0x0000000000000001
241246 ELF-MIPSEL-NEXT: Content: ''
242247 ELF-MIPSEL-NEXT: - Name: .rodata.str1.1
243248 ELF-MIPSEL-NEXT: Type: SHT_PROGBITS
249254 ELF-MIPSEL-NEXT: Flags: [ SHF_ALLOC ]
250255 ELF-MIPSEL-NEXT: AddressAlign: 0x0000000000000001
251256 ELF-MIPSEL-NEXT: Content: '000000000000000000000000000000000000000000000000'
257 ELF-MIPSEL-NEXT: - Name: .MIPS.abiflags
258 ELF-MIPSEL-NEXT: Type: SHT_MIPS_ABIFLAGS
259 ELF-MIPSEL-NEXT: Flags: [ SHF_ALLOC ]
260 ELF-MIPSEL-NEXT: AddressAlign: 0x0000000000000008
261 ELF-MIPSEL-NEXT: Content: '000020010101000100000000000000000100000000000000'
252262 ELF-MIPSEL-NEXT: Symbols:
253263 ELF-MIPSEL-NEXT: Local:
254264 ELF-MIPSEL-NEXT: - Name: trivial.ll
266276 ELF-MIPSEL-NEXT: - Name: .bss
267277 ELF-MIPSEL-NEXT: Type: STT_SECTION
268278 ELF-MIPSEL-NEXT: Section: .bss
279 ELF-MIPSEL-NEXT: - Name: .mdebug.abi32
280 ELF-MIPSEL-NEXT: Type: STT_SECTION
281 ELF-MIPSEL-NEXT: Section: .mdebug.abi32
269282 ELF-MIPSEL-NEXT: - Name: .rodata.str1.1
270283 ELF-MIPSEL-NEXT: Type: STT_SECTION
271284 ELF-MIPSEL-NEXT: Section: .rodata.str1.1
272285 ELF-MIPSEL-NEXT: - Name: .reginfo
273286 ELF-MIPSEL-NEXT: Type: STT_SECTION
274287 ELF-MIPSEL-NEXT: Section: .reginfo
288 ELF-MIPSEL-NEXT: - Name: .MIPS.abiflags
289 ELF-MIPSEL-NEXT: Type: STT_SECTION
290 ELF-MIPSEL-NEXT: Section: .MIPS.abiflags
275291 ELF-MIPSEL-NEXT: Global:
276292 ELF-MIPSEL-NEXT: - Name: main
277293 ELF-MIPSEL-NEXT: Type: STT_FUNC
278294 ELF-MIPSEL-NEXT: Section: .text
279295 ELF-MIPSEL-NEXT: Size: 0x000000000000004C
296 ELF-MIPSEL-NEXT: - Name: var
297 ELF-MIPSEL-NEXT: Type: STT_OBJECT
298 ELF-MIPSEL-NEXT: Section: .bss
299 ELF-MIPSEL-NEXT: Size: 0x0000000000000004
280300 ELF-MIPSEL-NEXT: - Name: SomeOtherFunction
281301 ELF-MIPSEL-NEXT: - Name: _gp_disp
282302 ELF-MIPSEL-NEXT: - Name: puts
11 RUN: | FileCheck %s -check-prefix COFF
22 RUN: llvm-readobj -s %p/Inputs/trivial.obj.elf-i386 \
33 RUN: | FileCheck %s -check-prefix ELF
4 RUN: llvm-readobj -s %p/Inputs/trivial.obj.elf-mipsel \
5 RUN: | FileCheck %s -check-prefix ELF-MIPSEL
46 RUN: llvm-readobj -s %p/Inputs/trivial.obj.macho-i386 \
57 RUN: | FileCheck %s -check-prefix MACHO-I386
68 RUN: llvm-readobj -s %p/Inputs/trivial.obj.macho-x86-64 \
8284 ELF-NEXT: AddressAlignment: 16
8385 ELF-NEXT: EntrySize: 0
8486 ELF-NEXT: }
87
88 ELF-MIPSEL: Section {
89 ELF-MIPSEL: Index: 4
90 ELF-MIPSEL-NEXT: Name: .reginfo (27)
91 ELF-MIPSEL-NEXT: Type: SHT_MIPS_REGINFO (0x70000006)
92 ELF-MIPSEL-NEXT: Flags [ (0x2)
93 ELF-MIPSEL-NEXT: SHF_ALLOC (0x2)
94 ELF-MIPSEL-NEXT: ]
95 ELF-MIPSEL-NEXT: Address: 0x0
96 ELF-MIPSEL-NEXT: Offset: 0x34
97 ELF-MIPSEL-NEXT: Size: 24
98 ELF-MIPSEL-NEXT: Link: 0
99 ELF-MIPSEL-NEXT: Info: 0
100 ELF-MIPSEL-NEXT: AddressAlignment: 1
101 ELF-MIPSEL-NEXT: EntrySize: 0
102 ELF-MIPSEL-NEXT: }
103 ELF-MIPSEL-NEXT: Section {
104 ELF-MIPSEL-NEXT: Index: 5
105 ELF-MIPSEL-NEXT: Name: .MIPS.abiflags (12)
106 ELF-MIPSEL-NEXT: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
107 ELF-MIPSEL-NEXT: Flags [ (0x2)
108 ELF-MIPSEL-NEXT: SHF_ALLOC (0x2)
109 ELF-MIPSEL-NEXT: ]
110 ELF-MIPSEL-NEXT: Address: 0x0
111 ELF-MIPSEL-NEXT: Offset: 0x50
112 ELF-MIPSEL-NEXT: Size: 24
113 ELF-MIPSEL-NEXT: Link: 0
114 ELF-MIPSEL-NEXT: Info: 0
115 ELF-MIPSEL-NEXT: AddressAlignment: 8
116 ELF-MIPSEL-NEXT: EntrySize: 0
117 ELF-MIPSEL-NEXT: }
85118
86119 MACHO-I386: Sections [
87120 MACHO-I386-NEXT: Section {
406406 switch (Type) {
407407 LLVM_READOBJ_ENUM_CASE(ELF, SHT_MIPS_REGINFO);
408408 LLVM_READOBJ_ENUM_CASE(ELF, SHT_MIPS_OPTIONS);
409 LLVM_READOBJ_ENUM_CASE(ELF, SHT_MIPS_ABIFLAGS);
409410 }
410411 }
411412