summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-readobj
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2018-10-25 05:39:27 +0000
committerSimon Atanasyan <simon@atanasyan.com>2018-10-25 05:39:27 +0000
commit199325450932a06d4392cb4d87fd69fc163b00eb (patch)
treee658a9ef06e390e0164dcb1dafc9ae373e75bd6a /llvm/test/tools/llvm-readobj
parent00897e9b7b88f0435565909480021803c21ca3b7 (diff)
downloadbcm5719-llvm-199325450932a06d4392cb4d87fd69fc163b00eb.tar.gz
bcm5719-llvm-199325450932a06d4392cb4d87fd69fc163b00eb.zip
[llvm-readobj] Print ELF header flags names in GNU output
GNU readelf tool prints hex value of the ELF header flags field and the flags names. This change adds the same functionality to llvm-readobj. Now llvm-readobj can print MIPS and RISCV flags. New GNUStyle::printFlags() method is a copy of ScopedPrinter::printFlags() routine. Probably we can escape code duplication and / or simplify the printFlags() method. But it's a task for separate commit. Differential revision: https://reviews.llvm.org/D52027 llvm-svn: 345238
Diffstat (limited to 'llvm/test/tools/llvm-readobj')
-rw-r--r--llvm/test/tools/llvm-readobj/gnu-file-headers.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-readobj/gnu-file-headers.test b/llvm/test/tools/llvm-readobj/gnu-file-headers.test
index 4b74d0948a3..e246a3d717b 100644
--- a/llvm/test/tools/llvm-readobj/gnu-file-headers.test
+++ b/llvm/test/tools/llvm-readobj/gnu-file-headers.test
@@ -2,6 +2,8 @@ RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-i386 --elf-output-style=GNU \
RUN: | FileCheck %s -check-prefix ELF32
RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-x86-64 --elf-output-style=GNU \
RUN: | FileCheck %s -check-prefix ELF64
+RUN: llvm-readobj -h %p/Inputs/trivial.obj.elf-mipsel --elf-output-style=GNU \
+RUN: | FileCheck %s -check-prefix MIPSEL
ELF32: ELF Header:
ELF32-NEXT: Magic: 7f 45 4c 46 01 01 01 03 00 00 00 00 00 00 00 00
@@ -44,3 +46,24 @@ ELF64-NEXT: Number of program headers: 0
ELF64-NEXT: Size of section headers: 64 (bytes)
ELF64-NEXT: Number of section headers: 10
ELF64-NEXT: Section header string table index: 7
+
+MIPSEL: ELF Header:
+MIPSEL-NEXT: Magic: 7f 45 4c 46 01 01 01 03 00 00 00 00 00 00 00 00
+MIPSEL-NEXT: Class: ELF32
+MIPSEL-NEXT: Data: 2's complement, little endian
+MIPSEL-NEXT: Version: 1 (current)
+MIPSEL-NEXT: OS/ABI: UNIX - GNU
+MIPSEL-NEXT: ABI Version: 0x0
+MIPSEL-NEXT: Type: REL (Relocatable file)
+MIPSEL-NEXT: Machine: MIPS R3000
+MIPSEL-NEXT: Version: 0x1
+MIPSEL-NEXT: Entry point address: 0x0
+MIPSEL-NEXT: Start of program headers: 0 (bytes into file)
+MIPSEL-NEXT: Start of section headers: 172 (bytes into file)
+MIPSEL-NEXT: Flags: 0x50001000, o32, mips32
+MIPSEL-NEXT: Size of this header: 52 (bytes)
+MIPSEL-NEXT: Size of program headers: 0 (bytes)
+MIPSEL-NEXT: Number of program headers: 0
+MIPSEL-NEXT: Size of section headers: 40 (bytes)
+MIPSEL-NEXT: Number of section headers: 9
+MIPSEL-NEXT: Section header string table index: 6
OpenPOWER on IntegriCloud