mirror of
https://github.com/fail0verflow/mini.git
synced 2024-11-28 06:04:19 +01:00
67 lines
1.4 KiB
C
67 lines
1.4 KiB
C
/*
|
|
mini - a Free Software replacement for the Nintendo/BroadOn IOS.
|
|
|
|
ELF loader: ELF structures
|
|
|
|
Copyright (C) 2008, 2009 Hector Martin "marcan" <marcan@marcansoft.com>
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, version 2.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
#ifndef __ELF_H__
|
|
#define __ELF_H__
|
|
|
|
#include "types.h"
|
|
|
|
#define EI_NIDENT 16
|
|
|
|
typedef struct {
|
|
unsigned char e_ident[EI_NIDENT];
|
|
u16 e_type;
|
|
u16 e_machine;
|
|
u32 e_version;
|
|
void *e_entry;
|
|
u32 e_phoff;
|
|
u32 e_shoff;
|
|
u32 e_flags;
|
|
u16 e_ehsize;
|
|
u16 e_phentsize;
|
|
u16 e_phnum;
|
|
u16 e_shentsize;
|
|
u16 e_shnum;
|
|
u16 e_shtrndx;
|
|
} Elf32_Ehdr;
|
|
|
|
typedef struct {
|
|
u32 p_type;
|
|
u32 p_offset;
|
|
void *p_vaddr;
|
|
void *p_paddr;
|
|
u32 p_filesz;
|
|
u32 p_memsz;
|
|
u32 p_flags;
|
|
u32 p_align;
|
|
} Elf32_Phdr;
|
|
|
|
#define PT_NULL 0
|
|
#define PT_LOAD 1
|
|
#define PT_DYNAMIC 2
|
|
#define PT_INTERP 3
|
|
#define PT_NOTE 4
|
|
#define PT_SHLIB 5
|
|
#define PT_PHDR 6
|
|
|
|
#endif
|
|
|