[llvm] r212908 - [Mips] Support SHT_MIPS_ABIFLAGS section type flag in the llvm-readobj,
Simon Atanasyan
simon at atanasyan.com
Sun Jul 13 08:28:54 PDT 2014
Author: atanasyan
Date: Sun Jul 13 10:28:54 2014
New Revision: 212908
URL: http://llvm.org/viewvc/llvm-project?rev=212908&view=rev
Log:
[Mips] Support SHT_MIPS_ABIFLAGS section type flag in the llvm-readobj,
obj2yaml and yaml2obj tools.
Added:
llvm/trunk/test/tools/llvm-readobj/Inputs/trivial.obj.elf-mipsel
Modified:
llvm/trunk/lib/Object/ELFYAML.cpp
llvm/trunk/test/MC/Mips/mips32/abiflags.s
llvm/trunk/test/MC/Mips/mips32r2/abiflags.s
llvm/trunk/test/MC/Mips/mips64/abiflags.s
llvm/trunk/test/MC/Mips/mips64r2/abiflags.s
llvm/trunk/test/MC/Mips/mips_abi_flags_xx.s
llvm/trunk/test/MC/Mips/mips_abi_flags_xx_set.s
llvm/trunk/test/MC/Mips/msa/abiflags.s
llvm/trunk/test/MC/Mips/nooddspreg-cmdarg.s
llvm/trunk/test/MC/Mips/nooddspreg.s
llvm/trunk/test/MC/Mips/oddspreg.s
llvm/trunk/test/Object/Inputs/trivial-object-test.elf-mipsel
llvm/trunk/test/Object/obj2yaml.test
llvm/trunk/test/tools/llvm-readobj/sections.test
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
Modified: llvm/trunk/lib/Object/ELFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ELFYAML.cpp?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ELFYAML.cpp (original)
+++ llvm/trunk/lib/Object/ELFYAML.cpp Sun Jul 13 10:28:54 2014
@@ -344,6 +344,7 @@ void ScalarEnumerationTraits<ELFYAML::EL
case ELF::EM_MIPS:
ECase(SHT_MIPS_REGINFO)
ECase(SHT_MIPS_OPTIONS)
+ ECase(SHT_MIPS_ABIFLAGS)
default:
// Nothing to do.
break;
Modified: llvm/trunk/test/MC/Mips/mips32/abiflags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips32/abiflags.s?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips32/abiflags.s (original)
+++ llvm/trunk/test/MC/Mips/mips32/abiflags.s Sun Jul 13 10:28:54 2014
@@ -11,7 +11,7 @@
# CHECK-OBJ: Section {
# CHECK-OBJ: Index: 5
# CHECK-OBJ: Name: .MIPS.abiflags (12)
-# CHECK-OBJ: Type: (0x7000002A)
+# CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
# CHECK-OBJ: Flags [ (0x2)
# CHECK-OBJ: SHF_ALLOC (0x2)
# CHECK-OBJ: ]
Modified: llvm/trunk/test/MC/Mips/mips32r2/abiflags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips32r2/abiflags.s?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips32r2/abiflags.s (original)
+++ llvm/trunk/test/MC/Mips/mips32r2/abiflags.s Sun Jul 13 10:28:54 2014
@@ -12,7 +12,7 @@
# CHECK-OBJ: Section {
# CHECK-OBJ: Index: 5
# CHECK-OBJ: Name: .MIPS.abiflags (12)
-# CHECK-OBJ: Type: (0x7000002A)
+# CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
# CHECK-OBJ: Flags [ (0x2)
# CHECK-OBJ: SHF_ALLOC (0x2)
# CHECK-OBJ: ]
Modified: llvm/trunk/test/MC/Mips/mips64/abiflags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips64/abiflags.s?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips64/abiflags.s (original)
+++ llvm/trunk/test/MC/Mips/mips64/abiflags.s Sun Jul 13 10:28:54 2014
@@ -11,7 +11,7 @@
# CHECK-OBJ: Section {
# CHECK-OBJ: Index: 5
# CHECK-OBJ: Name: .MIPS.abiflags (12)
-# CHECK-OBJ: Type: (0x7000002A)
+# CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
# CHECK-OBJ: Flags [ (0x2)
# CHECK-OBJ: SHF_ALLOC (0x2)
# CHECK-OBJ: ]
Modified: llvm/trunk/test/MC/Mips/mips64r2/abiflags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips64r2/abiflags.s?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips64r2/abiflags.s (original)
+++ llvm/trunk/test/MC/Mips/mips64r2/abiflags.s Sun Jul 13 10:28:54 2014
@@ -11,7 +11,7 @@
# CHECK-OBJ: Section {
# CHECK-OBJ: Index: 5
# CHECK-OBJ: Name: .MIPS.abiflags (12)
-# CHECK-OBJ: Type: (0x7000002A)
+# CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
# CHECK-OBJ: Flags [ (0x2)
# CHECK-OBJ: SHF_ALLOC (0x2)
# CHECK-OBJ: ]
Modified: llvm/trunk/test/MC/Mips/mips_abi_flags_xx.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips_abi_flags_xx.s?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips_abi_flags_xx.s (original)
+++ llvm/trunk/test/MC/Mips/mips_abi_flags_xx.s Sun Jul 13 10:28:54 2014
@@ -11,7 +11,7 @@
# CHECK-OBJ: Section {
# CHECK-OBJ: Index: 5
# CHECK-OBJ: Name: .MIPS.abiflags (12)
-# CHECK-OBJ: Type: (0x7000002A)
+# CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
# CHECK-OBJ: Flags [ (0x2)
# CHECK-OBJ: SHF_ALLOC (0x2)
# CHECK-OBJ: ]
Modified: llvm/trunk/test/MC/Mips/mips_abi_flags_xx_set.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips_abi_flags_xx_set.s?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips_abi_flags_xx_set.s (original)
+++ llvm/trunk/test/MC/Mips/mips_abi_flags_xx_set.s Sun Jul 13 10:28:54 2014
@@ -12,7 +12,7 @@
# CHECK-OBJ: Section {
# CHECK-OBJ: Index: 5
# CHECK-OBJ: Name: .MIPS.abiflags (12)
-# CHECK-OBJ: Type: (0x7000002A)
+# CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
# CHECK-OBJ: Flags [ (0x2)
# CHECK-OBJ: SHF_ALLOC (0x2)
# CHECK-OBJ: ]
Modified: llvm/trunk/test/MC/Mips/msa/abiflags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/msa/abiflags.s?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/msa/abiflags.s (original)
+++ llvm/trunk/test/MC/Mips/msa/abiflags.s Sun Jul 13 10:28:54 2014
@@ -12,7 +12,7 @@
# CHECK-OBJ: Section {
# CHECK-OBJ: Index: 5
# CHECK-OBJ: Name: .MIPS.abiflags (12)
-# CHECK-OBJ: Type: (0x7000002A)
+# CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
# CHECK-OBJ: Flags [ (0x2)
# CHECK-OBJ: SHF_ALLOC (0x2)
# CHECK-OBJ: ]
Modified: llvm/trunk/test/MC/Mips/nooddspreg-cmdarg.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/nooddspreg-cmdarg.s?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/nooddspreg-cmdarg.s (original)
+++ llvm/trunk/test/MC/Mips/nooddspreg-cmdarg.s Sun Jul 13 10:28:54 2014
@@ -17,7 +17,7 @@
# CHECK-OBJ: Section {
# CHECK-OBJ: Index: 5
# CHECK-OBJ: Name: .MIPS.abiflags (12)
-# CHECK-OBJ: Type: (0x7000002A)
+# CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
# CHECK-OBJ: Flags [ (0x2)
# CHECK-OBJ: SHF_ALLOC (0x2)
# CHECK-OBJ: ]
Modified: llvm/trunk/test/MC/Mips/nooddspreg.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/nooddspreg.s?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/nooddspreg.s (original)
+++ llvm/trunk/test/MC/Mips/nooddspreg.s Sun Jul 13 10:28:54 2014
@@ -17,7 +17,7 @@
# CHECK-OBJ: Section {
# CHECK-OBJ: Index: 5
# CHECK-OBJ: Name: .MIPS.abiflags (12)
-# CHECK-OBJ: Type: (0x7000002A)
+# CHECK-OBJ: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
# CHECK-OBJ: Flags [ (0x2)
# CHECK-OBJ: SHF_ALLOC (0x2)
# CHECK-OBJ: ]
Modified: llvm/trunk/test/MC/Mips/oddspreg.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/oddspreg.s?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/oddspreg.s (original)
+++ llvm/trunk/test/MC/Mips/oddspreg.s Sun Jul 13 10:28:54 2014
@@ -25,7 +25,7 @@
# CHECK-OBJ-ALL: Section {
# CHECK-OBJ-ALL: Index: 5
# CHECK-OBJ-ALL: Name: .MIPS.abiflags ({{[0-9]+}})
-# CHECK-OBJ-ALL: Type: (0x7000002A)
+# CHECK-OBJ-ALL: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
# CHECK-OBJ-ALL: Flags [ (0x2)
# CHECK-OBJ-ALL: SHF_ALLOC (0x2)
# CHECK-OBJ-ALL: ]
Modified: llvm/trunk/test/Object/Inputs/trivial-object-test.elf-mipsel
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/trivial-object-test.elf-mipsel?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
Binary files llvm/trunk/test/Object/Inputs/trivial-object-test.elf-mipsel (original) and llvm/trunk/test/Object/Inputs/trivial-object-test.elf-mipsel Sun Jul 13 10:28:54 2014 differ
Modified: llvm/trunk/test/Object/obj2yaml.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/obj2yaml.test?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/test/Object/obj2yaml.test (original)
+++ llvm/trunk/test/Object/obj2yaml.test Sun Jul 13 10:28:54 2014
@@ -191,6 +191,7 @@ COFF-X86-64-NEXT: StorageClass: IMAG
ELF-MIPSEL: FileHeader:
ELF-MIPSEL-NEXT: Class: ELFCLASS32
ELF-MIPSEL-NEXT: Data: ELFDATA2LSB
+ELF-MIPSEL-NEXT: OSABI: ELFOSABI_GNU
ELF-MIPSEL-NEXT: Type: ET_REL
ELF-MIPSEL-NEXT: Machine: EM_MIPS
ELF-MIPSEL-NEXT: Flags: [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
@@ -206,7 +207,7 @@ ELF-MIPSEL-NEXT: Link: .s
ELF-MIPSEL-NEXT: AddressAlign: 0x0000000000000004
ELF-MIPSEL-NEXT: Info: .text
ELF-MIPSEL-NEXT: Relocations:
-ELF-MIPSEL-NEXT: - Offset: 0
+ELF-MIPSEL-NEXT: - Offset: 0x0000000000000000
ELF-MIPSEL-NEXT: Symbol: _gp_disp
ELF-MIPSEL-NEXT: Type: R_MIPS_HI16
ELF-MIPSEL-NEXT: Addend: 0
@@ -239,6 +240,10 @@ ELF-MIPSEL-NEXT: - Name: .b
ELF-MIPSEL-NEXT: Type: SHT_NOBITS
ELF-MIPSEL-NEXT: Flags: [ SHF_WRITE, SHF_ALLOC ]
ELF-MIPSEL-NEXT: AddressAlign: 0x0000000000000004
+ELF-MIPSEL-NEXT: Content: 48656C6C
+ELF-MIPSEL-NEXT: - Name: .mdebug.abi32
+ELF-MIPSEL-NEXT: Type: SHT_PROGBITS
+ELF-MIPSEL-NEXT: AddressAlign: 0x0000000000000001
ELF-MIPSEL-NEXT: Content: ''
ELF-MIPSEL-NEXT: - Name: .rodata.str1.1
ELF-MIPSEL-NEXT: Type: SHT_PROGBITS
@@ -250,6 +255,11 @@ ELF-MIPSEL-NEXT: Type: SH
ELF-MIPSEL-NEXT: Flags: [ SHF_ALLOC ]
ELF-MIPSEL-NEXT: AddressAlign: 0x0000000000000001
ELF-MIPSEL-NEXT: Content: '000000000000000000000000000000000000000000000000'
+ELF-MIPSEL-NEXT: - Name: .MIPS.abiflags
+ELF-MIPSEL-NEXT: Type: SHT_MIPS_ABIFLAGS
+ELF-MIPSEL-NEXT: Flags: [ SHF_ALLOC ]
+ELF-MIPSEL-NEXT: AddressAlign: 0x0000000000000008
+ELF-MIPSEL-NEXT: Content: '000020010101000100000000000000000100000000000000'
ELF-MIPSEL-NEXT: Symbols:
ELF-MIPSEL-NEXT: Local:
ELF-MIPSEL-NEXT: - Name: trivial.ll
@@ -267,17 +277,27 @@ ELF-MIPSEL-NEXT: Section:
ELF-MIPSEL-NEXT: - Name: .bss
ELF-MIPSEL-NEXT: Type: STT_SECTION
ELF-MIPSEL-NEXT: Section: .bss
+ELF-MIPSEL-NEXT: - Name: .mdebug.abi32
+ELF-MIPSEL-NEXT: Type: STT_SECTION
+ELF-MIPSEL-NEXT: Section: .mdebug.abi32
ELF-MIPSEL-NEXT: - Name: .rodata.str1.1
ELF-MIPSEL-NEXT: Type: STT_SECTION
ELF-MIPSEL-NEXT: Section: .rodata.str1.1
ELF-MIPSEL-NEXT: - Name: .reginfo
ELF-MIPSEL-NEXT: Type: STT_SECTION
ELF-MIPSEL-NEXT: Section: .reginfo
+ELF-MIPSEL-NEXT: - Name: .MIPS.abiflags
+ELF-MIPSEL-NEXT: Type: STT_SECTION
+ELF-MIPSEL-NEXT: Section: .MIPS.abiflags
ELF-MIPSEL-NEXT: Global:
ELF-MIPSEL-NEXT: - Name: main
ELF-MIPSEL-NEXT: Type: STT_FUNC
ELF-MIPSEL-NEXT: Section: .text
ELF-MIPSEL-NEXT: Size: 0x000000000000004C
+ELF-MIPSEL-NEXT: - Name: var
+ELF-MIPSEL-NEXT: Type: STT_OBJECT
+ELF-MIPSEL-NEXT: Section: .bss
+ELF-MIPSEL-NEXT: Size: 0x0000000000000004
ELF-MIPSEL-NEXT: - Name: SomeOtherFunction
ELF-MIPSEL-NEXT: - Name: _gp_disp
ELF-MIPSEL-NEXT: - Name: puts
Added: llvm/trunk/test/tools/llvm-readobj/Inputs/trivial.obj.elf-mipsel
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/trivial.obj.elf-mipsel?rev=212908&view=auto
==============================================================================
Binary files llvm/trunk/test/tools/llvm-readobj/Inputs/trivial.obj.elf-mipsel (added) and llvm/trunk/test/tools/llvm-readobj/Inputs/trivial.obj.elf-mipsel Sun Jul 13 10:28:54 2014 differ
Modified: llvm/trunk/test/tools/llvm-readobj/sections.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/sections.test?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/sections.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/sections.test Sun Jul 13 10:28:54 2014
@@ -2,6 +2,8 @@ RUN: llvm-readobj -s %p/Inputs/trivial.o
RUN: | FileCheck %s -check-prefix COFF
RUN: llvm-readobj -s %p/Inputs/trivial.obj.elf-i386 \
RUN: | FileCheck %s -check-prefix ELF
+RUN: llvm-readobj -s %p/Inputs/trivial.obj.elf-mipsel \
+RUN: | FileCheck %s -check-prefix ELF-MIPSEL
RUN: llvm-readobj -s %p/Inputs/trivial.obj.macho-i386 \
RUN: | FileCheck %s -check-prefix MACHO-I386
RUN: llvm-readobj -s %p/Inputs/trivial.obj.macho-x86-64 \
@@ -84,6 +86,37 @@ ELF-NEXT: AddressAlignment: 16
ELF-NEXT: EntrySize: 0
ELF-NEXT: }
+ELF-MIPSEL: Section {
+ELF-MIPSEL: Index: 4
+ELF-MIPSEL-NEXT: Name: .reginfo (27)
+ELF-MIPSEL-NEXT: Type: SHT_MIPS_REGINFO (0x70000006)
+ELF-MIPSEL-NEXT: Flags [ (0x2)
+ELF-MIPSEL-NEXT: SHF_ALLOC (0x2)
+ELF-MIPSEL-NEXT: ]
+ELF-MIPSEL-NEXT: Address: 0x0
+ELF-MIPSEL-NEXT: Offset: 0x34
+ELF-MIPSEL-NEXT: Size: 24
+ELF-MIPSEL-NEXT: Link: 0
+ELF-MIPSEL-NEXT: Info: 0
+ELF-MIPSEL-NEXT: AddressAlignment: 1
+ELF-MIPSEL-NEXT: EntrySize: 0
+ELF-MIPSEL-NEXT: }
+ELF-MIPSEL-NEXT: Section {
+ELF-MIPSEL-NEXT: Index: 5
+ELF-MIPSEL-NEXT: Name: .MIPS.abiflags (12)
+ELF-MIPSEL-NEXT: Type: SHT_MIPS_ABIFLAGS (0x7000002A)
+ELF-MIPSEL-NEXT: Flags [ (0x2)
+ELF-MIPSEL-NEXT: SHF_ALLOC (0x2)
+ELF-MIPSEL-NEXT: ]
+ELF-MIPSEL-NEXT: Address: 0x0
+ELF-MIPSEL-NEXT: Offset: 0x50
+ELF-MIPSEL-NEXT: Size: 24
+ELF-MIPSEL-NEXT: Link: 0
+ELF-MIPSEL-NEXT: Info: 0
+ELF-MIPSEL-NEXT: AddressAlignment: 8
+ELF-MIPSEL-NEXT: EntrySize: 0
+ELF-MIPSEL-NEXT: }
+
MACHO-I386: Sections [
MACHO-I386-NEXT: Section {
MACHO-I386-NEXT: Index: 0
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=212908&r1=212907&r2=212908&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Sun Jul 13 10:28:54 2014
@@ -407,6 +407,7 @@ static const char *getElfSectionType(uns
switch (Type) {
LLVM_READOBJ_ENUM_CASE(ELF, SHT_MIPS_REGINFO);
LLVM_READOBJ_ENUM_CASE(ELF, SHT_MIPS_OPTIONS);
+ LLVM_READOBJ_ENUM_CASE(ELF, SHT_MIPS_ABIFLAGS);
}
}
More information about the llvm-commits
mailing list