[PowerPC64] readelf: print description for 'e_flags' in ELF header (ABI type)

This prints out description text with the meaning of 'Flags' value in PowerPC64.

Example:

$ readelf -h ~/tmp/t1-Flag2
ELF Header:

Magic:   7f 45 4c 46 02 02 01 09 00 00 00 00 00 00 00 00
Class:                             ELF64
Data:                              2's complement, big endian
Version:                           1 (current)
OS/ABI:                            FreeBSD
ABI Version:                       0
Type:                              EXEC (Executable file)
Machine:                           PowerPC 64-bit
Version:                           0x1
Entry point address:               0x10010000
Start of program headers:          64 (bytes into file)
Start of section headers:          209368 (bytes into file)
Flags:                             0x2, OpenPOWER ELF V2 ABI
Size of this header:               64 (bytes)
Size of program headers:           56 (bytes)
Number of program headers:         10
Size of section headers:           64 (bytes)
Number of section headers:         34
Section header string table index: 31

Submitted by:	 alfredo.junior_eldorado.org.br
Reviewed by:	luporl
Differential Revision:	https://reviews.freebsd.org/D20782
This commit is contained in:
Leandro Lupori 2019-06-28 16:00:55 +00:00
parent c4e127e24d
commit 857e20a273

View File

@ -2297,8 +2297,15 @@ dump_eflags(struct readelf *re, uint64_t e_flags)
}
edesc = mips_eflags_desc;
break;
case EM_PPC:
case EM_PPC64:
switch (e_flags) {
case 0: printf(", Unspecified or Power ELF V1 ABI"); break;
case 1: printf(", Power ELF V1 ABI"); break;
case 2: printf(", OpenPOWER ELF V2 ABI"); break;
default: break;
}
/* explicit fall through*/
case EM_PPC:
edesc = powerpc_eflags_desc;
break;
case EM_RISCV: