libdragon
Loading...
Searching...
No Matches
dso_format.h
1#ifndef __DSO_FORMAT_H
2#define __DSO_FORMAT_H
3
4#include <stdint.h>
5#include <stdbool.h>
6
8#define DSO_MAGIC 0x44534F30 //'DSO0'
10#define DSO_MAINEXE_SYM_DATA_MAGIC 0x4D53594D //'MSYM'
11
13#define DSO_SYMS_OFS 0x18
15#define DSO_NUM_IMPORT_SYMS_OFS 0x20
17#define DSO_SYM_SIZE 0xC
18
20typedef struct dso_sym_s {
21 char *name;
22 uint32_t value;
23 uint32_t info;
24} dso_sym_t;
25
27typedef struct dso_reloc_s {
28 uint32_t offset;
29 uint32_t info;
31
33typedef struct dso_module_s {
34 uint32_t magic;
35 struct dso_module_s *prev;
36 struct dso_module_s *next;
37 uint32_t ref_count;
38 char *src_elf;
39 char *filename;
41 uint32_t num_syms;
42 uint32_t num_import_syms;
44 uint32_t num_relocs;
45 void *prog_base;
46 uint32_t prog_size;
47 uint32_t ehframe_obj[6];
48 uint32_t sym_romofs;
49 uint32_t mode;
51
53typedef struct mainexe_sym_info_s {
54 uint32_t magic;
55 uint32_t size;
56 uint32_t num_syms;
58
59#endif
DSO module data.
Definition dso_format.h:33
char * filename
Filename data.
Definition dso_format.h:39
uint32_t sym_romofs
Debug symbol data rom address.
Definition dso_format.h:48
uint32_t num_syms
Number of symbols (includes dummy symbol at start of array)
Definition dso_format.h:41
uint32_t num_relocs
Number of relocations.
Definition dso_format.h:44
uint32_t num_import_syms
Number of symbols imported.
Definition dso_format.h:42
struct dso_module_s * next
Next loaded dynamic library.
Definition dso_format.h:36
uint32_t magic
Magic number.
Definition dso_format.h:34
dso_sym_t * syms
Symbols array.
Definition dso_format.h:40
uint32_t prog_size
Size of program memory image.
Definition dso_format.h:46
void * prog_base
Pointer to program memory image.
Definition dso_format.h:45
uint32_t ref_count
Dynamic library reference count.
Definition dso_format.h:37
uint32_t mode
Dynamic library flags.
Definition dso_format.h:49
struct dso_module_s * prev
Previous loaded dynamic library.
Definition dso_format.h:35
char * src_elf
Path to Source ELF.
Definition dso_format.h:38
dso_reloc_t * relocs
Relocation array.
Definition dso_format.h:43
DSO relocation.
Definition dso_format.h:27
uint32_t offset
Program-relative offset of relocation target.
Definition dso_format.h:28
uint32_t info
Top 8 bits: type; lowest 24 bits: symbol index.
Definition dso_format.h:29
DSO symbol.
Definition dso_format.h:20
uint32_t info
Top bit: absolute flag; Next bit: weak flag; lowest 30 bits: size.
Definition dso_format.h:23
char * name
Name of symbol.
Definition dso_format.h:21
uint32_t value
Pointer to symbol.
Definition dso_format.h:22
Information to load main executable symbol table.
Definition dso_format.h:53
uint32_t size
Size of data to load.
Definition dso_format.h:55
uint32_t magic
Magic number.
Definition dso_format.h:54
uint32_t num_syms
Number of symbols in this symbol table.
Definition dso_format.h:56