1
0
mirror of https://github.com/upx/upx synced 2025-10-12 20:59:43 +08:00

definitions for Elf64_*

committer: jreiser <jreiser> 1131564732 +0000
This commit is contained in:
John Reiser 2005-11-09 19:32:12 +00:00
parent 0c328372b5
commit ac441fd1cf

View File

@ -77,6 +77,8 @@ struct timespec {
// misc constants // misc constants
#if defined(__amd64__) || defined(__powerpc64__) #if defined(__amd64__) || defined(__powerpc64__)
#define PAGE_MASK (~0ul<<12) // discards the offset, keeps the page
#define PAGE_SIZE ( 1ul<<12)
#elif defined(__i386__) || defined(__powerpc__) #elif defined(__i386__) || defined(__powerpc__)
#define PAGE_MASK (~0ul<<12) // discards the offset, keeps the page #define PAGE_MASK (~0ul<<12) // discards the offset, keeps the page
#define PAGE_SIZE ( 1ul<<12) #define PAGE_SIZE ( 1ul<<12)
@ -389,6 +391,24 @@ typedef struct
Elf32_Half e_shstrndx; Elf32_Half e_shstrndx;
} Elf32_Ehdr; } Elf32_Ehdr;
typedef struct
{
unsigned char e_ident[EI_NIDENT];
Elf64_Half e_type;
Elf64_Half e_machine;
Elf64_Word e_version;
Elf64_Addr e_entry;
Elf64_Off e_phoff;
Elf64_Off e_shoff;
Elf64_Word e_flags;
Elf64_Half e_ehsize;
Elf64_Half e_phentsize;
Elf64_Half e_phnum;
Elf64_Half e_shentsize;
Elf64_Half e_shnum;
Elf64_Half e_shstrndx;
} Elf64_Ehdr;
typedef struct typedef struct
{ {
Elf32_Word p_type; Elf32_Word p_type;
@ -401,6 +421,18 @@ typedef struct
Elf32_Word p_align; Elf32_Word p_align;
} Elf32_Phdr; } Elf32_Phdr;
typedef struct
{
Elf64_Word p_type;
Elf64_Word p_flags;
Elf64_Off p_offset;
Elf64_Addr p_vaddr;
Elf64_Addr p_paddr;
Elf64_Xword p_filesz;
Elf64_Xword p_memsz;
Elf64_Xword p_align;
} Elf64_Phdr;
typedef struct typedef struct
{ {
uint32_t a_type; uint32_t a_type;
@ -409,6 +441,14 @@ typedef struct
} a_un; } a_un;
} Elf32_auxv_t; } Elf32_auxv_t;
typedef struct
{
uint64_t a_type;
union
{
uint64_t a_val;
} a_un;
} Elf64_auxv_t;
#define AT_NULL 0 #define AT_NULL 0
#define AT_IGNORE 1 #define AT_IGNORE 1