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