PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
ELF.h
1
/* ELF-loading stuff */
2
#define ELF_MAGIC 0x464c457f
3
#define ELF_TYPE_SCE_IRX 0xFF80
/* SCE IOP Relocatable eXcutable file */
4
#define ELF_PT_LOAD 1
5
6
/*------------------------------*/
7
typedef
struct
8
{
9
u8 ident[16];
/* Structure of a ELF header */
10
u16 type;
11
u16 machine;
12
u32
version
;
13
u32 entry;
14
u32 phoff;
15
u32 shoff;
16
u32 flags;
17
u16 ehsize;
18
u16 phentsize;
19
u16 phnum;
20
u16 shentsize;
21
u16 shnum;
22
u16 shstrndx;
23
}
elf_header_t
;
24
/*------------------------------*/
25
typedef
struct
26
{
27
u32 type;
/* Structure of a header a sections in an ELF */
28
u32 offset;
29
void
*vaddr;
30
u32 paddr;
31
u32 filesz;
32
u32 memsz;
33
u32 flags;
34
u32 align;
35
}
elf_pheader_t
;
36
37
typedef
struct
38
{
39
u32 name;
40
u32 type;
41
u32 flags;
42
u32 addr;
43
u32 offset;
44
u32 size;
45
u32 link;
46
u32
info
;
47
u32 addralign;
48
u32 entsize;
49
}
elf_shdr_t
;
50
51
typedef
struct
52
{
53
u32 offset;
54
u32
info
;
55
}
elf_rel
;
56
57
typedef
struct
58
{
59
u32 offset;
60
u32
info
;
61
u32 addend;
62
}
elf_rela
;
63
64
enum
ELF_SHT_types {
65
SHT_NULL = 0,
66
SHT_PROGBITS,
67
SHT_SYMTAB,
68
SHT_STRTAB,
69
SHT_RELA,
70
SHT_HASH,
71
SHT_DYNAMIC,
72
SHT_NOTE,
73
SHT_NOBITS,
74
SHT_REL,
75
SHT_SHLIB,
76
SHT_DYNSYM
77
};
78
79
enum
ELF_reloc_types {
80
R_MIPS_NONE = 0,
81
R_MIPS_16,
82
R_MIPS_32,
83
R_MIPS_REL32,
84
R_MIPS_26,
85
R_MIPS_HI16,
86
R_MIPS_LO16
87
};
88
89
#define SHT_LOPROC 0x70000000
90
#define SHT_LOPROC_EE_IMPORT_TAB 0x90
91
#define SHT_LOPROC_IOPMOD 0x80
92
#define SHT_HIPROC 0x7fffffff
93
#define SHT_LOUSER 0x80000000
94
#define SHT_HIUSER 0xffffffff
95
96
#define SHF_WRITE 0x1
97
#define SHF_ALLOC 0x2
98
#define SHF_EXECINSTR 0x4
99
#define SHF_MASKPROC 0xf0000000
100
101
struct
iopmod_id
102
{
103
const
char
*name;
104
unsigned
short
int
version;
105
};
106
107
struct
iopmod
108
{
109
struct
iopmod_id
*mod_id;
// 0x00
110
void
*EntryPoint;
// 0x04
111
void
*gp;
// 0x08
112
unsigned
int
text_size;
// 0x0C
113
unsigned
int
data_size;
// 0x10
114
unsigned
int
bss_size;
// 0x14
115
unsigned
short
int
version
;
// 0x18
116
char
modname[1];
// 0x1A
117
};
version
unsigned int version
Definition
fileXio.h:3
elf_header_t
Definition
elf.h:21
elf_pheader_t
Definition
elf.h:39
elf_rel
Definition
loadcore.c:71
elf_rela
Definition
loadcore.c:77
elf_shdr_t
Definition
loadcore.c:57
iopmod_id
Definition
ELF.h:102
iopmod
Definition
loadcore.c:125
s_info
Definition
xprintf.c:78
iop
system
udnl
src
include
ELF.h
Generated on Thu Nov 14 2024 05:25:24 for PS2SDK by
1.9.8