elf: Add support for PPC64 ELF V1 ABI in bootelf

This update adds PPC64 ELF V1 ABI support to bootelf for both the
program header and section header options. Elf64 support was already
present for the program header option, but it was not handling the
PPC64 ELF V1 ABI case. For the PPC64 ELF V1 ABI, the e_entry field of
the elf header must be treated as function descriptor pointer instead
of a function address. The first doubleword of the function descriptor
is the function's entry address.

Signed-off-by: Rob Bracero <robbracero@gmail.com>
[trini: Fix whitespace issues]
Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Rob Bracero 2018-07-31 22:57:42 -04:00 committed by Tom Rini
parent 9beb490610
commit 2846ea81a0
2 changed files with 78 additions and 0 deletions

View file

@ -593,6 +593,9 @@ unsigned long elf_hash(const unsigned char *name);
/* Values for Elf32/64_Ehdr.e_flags */
#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */
#define EF_PPC64_ELFV1_ABI 0x00000001
#define EF_PPC64_ELFV2_ABI 0x00000002
/* Cygnus local bits below */
#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/
#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib