Provide ELF definitions for 64-bit PowerPC. This unbreaks the powerpc
loader build.
This commit is contained in:
Nathan Whitehorn 2010-07-12 13:38:26 +00:00
parent cd646aba81
commit d83af91b99

View File

@ -36,14 +36,26 @@
* [ppc-eabi-1995-01.pdf] for details.
*/
#include <sys/elf32.h> /* Definitions common to all 32 bit architectures. */
#ifndef __ELF_WORD_SIZE
#ifdef __powerpc64__
#define __ELF_WORD_SIZE 64 /* Used by <sys/elf_generic.h> */
#else
#define __ELF_WORD_SIZE 32 /* Used by <sys/elf_generic.h> */
#endif
#endif
#include <sys/elf32.h> /* Definitions common to all 32 bit architectures. */
#include <sys/elf64.h> /* Definitions common to all 64 bit architectures. */
#include <sys/elf_generic.h>
#if __ELF_WORD_SIZE == 64
#define ELF_ARCH EM_PPC64
#define ELF_MACHINE_OK(x) ((x) == EM_PPC64)
#else
#define ELF_ARCH EM_PPC
#define ELF_ARCH32 EM_PPC
#define ELF_MACHINE_OK(x) ((x) == EM_PPC)
#endif
/*
* Auxiliary vector entries for passing information to the interpreter.
@ -61,6 +73,15 @@ typedef struct { /* Auxiliary vector entry on initial stack */
} a_un;
} Elf32_Auxinfo;
typedef struct { /* Auxiliary vector entry on initial stack */
long a_type; /* Entry type. */
union {
long a_val; /* Integer value. */
void *a_ptr; /* Address. */
void (*a_fcn)(void); /* Function pointer (not used). */
} a_un;
} Elf64_Auxinfo;
__ElfType(Auxinfo);
/* Values for a_type. */
@ -91,10 +112,17 @@ __ElfType(Auxinfo);
#define R_PPC_EMB_COUNT (R_PPC_EMB_RELSDA - R_PPC_EMB_NADDR32 + 1)
/* Define "machine" characteristics */
#if __ELF_WORD_SIZE == 64
#define ELF_TARG_CLASS ELFCLASS64
#define ELF_TARG_DATA ELFDATA2MSB
#define ELF_TARG_MACH EM_PPC64
#define ELF_TARG_VER 1
#else
#define ELF_TARG_CLASS ELFCLASS32
#define ELF_TARG_DATA ELFDATA2MSB
#define ELF_TARG_MACH EM_PPC
#define ELF_TARG_VER 1
#endif
#define ET_DYN_LOAD_ADDR 0x01010000