PS2SDK
PS2 Homebrew Libraries
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/fcntl.h>
#include <sys/unistd.h>
#include <erl.h>
#include <hashtab.h>
#include <recycle.h>
Go to the source code of this file.
Data Structures | |
struct | elf_header_t |
struct | elf_section_t |
struct | elf_symbol_t |
struct | elf_reloc_t |
struct | elf_rela_t |
struct | loosy_t |
struct | dependancy_t |
union | elf_header_t.e_ident |
struct | e_ident_t.e_ident.cook |
Macros | |
#define | DEBUG 1 |
#define | STANDALONE 1 |
#define | FORCE_ALIGN 1 |
#define | dprintf(a...) do { } while(0) |
#define | rprintf(a...) do { } while(0) |
#define | REL_TYPE 1 |
#define | PROGBITS 1 |
#define | NOBITS 8 |
#define | REL 9 |
#define | RELA 4 |
#define | GLOBAL 1 |
#define | WEAK 2 |
#define | NOTYPE 0 |
#define | OBJECT 1 |
#define | FUNC 2 |
#define | SECTION 3 |
#define | R_MIPS_32 2 |
#define | R_MIPS_26 4 |
#define | R_MIPS_HI16 5 |
#define | R_MIPS_LO16 6 |
#define | free_and_return(code) |
#define | O_BINARY 0 |
Typedefs | |
typedef unsigned char | u8 |
typedef unsigned short | u16 |
typedef unsigned int | u32 |
typedef signed char | s8 |
typedef signed short | s16 |
typedef signed int | s32 |
typedef int(* | func_t) (void) |
typedef int(* | start_t) (int argc, char **argv) |
Functions | |
static u32 | align (u32 x, int align) |
static struct loosy_t * | create_loosy (struct erl_record_t *erl, u8 *reloc, int type) |
static void | destroy_loosy (struct loosy_t *l) |
static void | r_destroy_loosy (struct loosy_t *l) |
static struct symbol_t * | create_symbol (struct erl_record_t *provider, u32 address) |
static void | destroy_symbol (struct symbol_t *s) |
static struct erl_record_t * | allocate_erl_record () |
static void | destroy_erl_record (struct erl_record_t *erl) |
static int | apply_reloc (u8 *reloc, int type, u32 addr) |
struct symbol_t * | erl_find_local_symbol (const char *symbol, struct erl_record_t *erl) |
static struct symbol_t * | r_find_symbol (const char *symbol, struct erl_record_t *erl) |
struct symbol_t * | erl_find_symbol (const char *symbol) |
static struct dependancy_t * | add_dependancy (struct erl_record_t *depender, struct erl_record_t *provider) |
static void | destroy_dependancy (struct dependancy_t *d) |
static void | r_destroy_dependancy_r (struct erl_record_t *erl, struct dependancy_t *d) |
static void | destroy_dependancy_r (struct erl_record_t *erl) |
static void | add_loosy (struct erl_record_t *erl, u8 *reloc, int type, const char *symbol) |
static int | fix_loosy (struct erl_record_t *provider, const char *symbol, u32 address) |
static int | is_local (const char *symbol) |
static int | add_symbol (struct erl_record_t *erl, const char *symbol, u32 address) |
int | erl_add_global_symbol (const char *symbol, u32 address) |
static int | read_erl (int elf_handle, u8 *elf_mem, u32 addr, struct erl_record_t **p_erl_record) |
static struct erl_record_t * | _init_load_erl_wrapper_from_file (char *erl_id) |
static struct erl_record_t * | load_erl (const char *fname, u8 *elf_mem, u32 addr, int argc, char **argv) |
struct erl_record_t * | _init_load_erl_from_file (const char *fname, char *erl_id) |
struct erl_record_t * | load_erl_from_file (const char *fname, int argc, char **argv) |
struct erl_record_t * | load_erl_from_mem (u8 *mem, int argc, char **argv) |
struct erl_record_t * | load_erl_from_mem_to_addr (u8 *mem, u32 addr, int argc, char **argv) |
struct erl_record_t * | load_erl_from_file_to_addr (const char *fname, u32 addr, int argc, char **argv) |
struct erl_record_t * | _init_load_erl_from_file_to_addr (const char *fname, u32 addr, char *erl_id) |
void | r_unload_dependancies (char **d) |
int | unload_erl (struct erl_record_t *erl) |
struct erl_record_t * | erl_resolve (u32 address) |
struct erl_record_t * | find_erl (const char *name) |
void | erl_flush_symbols (struct erl_record_t *erl) |
Variables | |
static const char * | local_names [] |
static struct erl_record_t * | erl_record_root = 0 |
static htab * | global_symbols = 0 |
static htab * | loosy_relocs = 0 |
char | _init_erl_prefix [256] = "" |
static struct dependancy_t * | dependancy_root = 0 |
static reroot * | symbol_recycle = 0 |
erl_loader_t | _init_load_erl = _init_load_erl_wrapper_from_file |
The relocatable elf loader/linker.
Definition in file erl.c.
struct elf_section_t |
struct elf_symbol_t |
struct elf_rela_t |
struct loosy_t |
Data Fields | ||
---|---|---|
u8 * | reloc | |
int | type | |
struct loosy_t * | next | |
struct erl_record_t * | erl |
struct dependancy_t |
Data Fields | ||
---|---|---|
struct erl_record_t * | depender | |
struct erl_record_t * | provider | |
struct dependancy_t * | next | |
struct dependancy_t * | prev |
union elf_header_t.e_ident |
Data Fields | ||
---|---|---|
u8 | raw[16] | |
struct e_ident_t.e_ident.cook | cook |
struct elf_header_t::e_ident_t.e_ident.cook |
#define free_and_return | ( | code | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
struct symbol_t * erl_find_local_symbol | ( | const char * | symbol, |
struct erl_record_t * | erl | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int erl_add_global_symbol | ( | const char * | symbol, |
u32 | address | ||
) |
|
static |
|
static |
|
static |
struct erl_record_t * _init_load_erl_from_file | ( | const char * | fname, |
char * | erl_id | ||
) |
struct erl_record_t * load_erl_from_file | ( | const char * | fname, |
int | argc, | ||
char ** | argv | ||
) |
struct erl_record_t * load_erl_from_mem | ( | u8 * | mem, |
int | argc, | ||
char ** | argv | ||
) |
struct erl_record_t * load_erl_from_mem_to_addr | ( | u8 * | mem, |
u32 | addr, | ||
int | argc, | ||
char ** | argv | ||
) |
struct erl_record_t * load_erl_from_file_to_addr | ( | const char * | fname, |
u32 | addr, | ||
int | argc, | ||
char ** | argv | ||
) |
struct erl_record_t * _init_load_erl_from_file_to_addr | ( | const char * | fname, |
u32 | addr, | ||
char * | erl_id | ||
) |
int unload_erl | ( | struct erl_record_t * | erl | ) |
struct erl_record_t * erl_resolve | ( | u32 | address | ) |
struct erl_record_t * find_erl | ( | const char * | name | ) |
void erl_flush_symbols | ( | struct erl_record_t * | erl | ) |
|
static |
|
static |
|
static |