aboutsummaryrefslogtreecommitdiff
path: root/tools/util/elf.h
diff options
context:
space:
mode:
authorJohn Wilbert M. Villamor <lameguy64@gmail.com>2021-02-18 13:31:17 +0800
committerJohn Wilbert M. Villamor <lameguy64@gmail.com>2021-02-18 13:31:17 +0800
commit63419d9cc07c56234d0f61a80f32105b192aec8e (patch)
tree827cf4d134cf3b4618d0167cc912f3efd47c3aac /tools/util/elf.h
parent1625072293c40ba3cb819f8f48aeb4b64e93b133 (diff)
downloadpsn00bsdk-63419d9cc07c56234d0f61a80f32105b192aec8e.tar.gz
Lots of makefile corrections, improved build and toolchain instructions, added elf2cpe converter, fixed typo in plasma_tbl.h of n00bdemo example
Diffstat (limited to 'tools/util/elf.h')
-rw-r--r--tools/util/elf.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/tools/util/elf.h b/tools/util/elf.h
new file mode 100644
index 0000000..9cb5cb3
--- /dev/null
+++ b/tools/util/elf.h
@@ -0,0 +1,45 @@
+#ifndef _ELF_H
+#define _ELF_H
+
+#pragma pack(push, 1)
+
+typedef struct {
+
+ unsigned int magic; // 0-3
+ unsigned char word_size; // 4
+ unsigned char endianness; // 5
+ unsigned char elf_version; // 6
+ unsigned char os_abi; // 7
+ unsigned int unused[2]; // 8-15
+
+ unsigned short type; // 16-17
+ unsigned short instr_set; // 18-19
+ unsigned int elf_version2; // 20-23
+
+ unsigned int prg_entry_addr; // 24-27
+ unsigned int prg_head_pos; // 28-31
+ unsigned int sec_head_pos; // 32-35
+ unsigned int flags; // 36-39
+ unsigned short head_size; // 40-41
+ unsigned short prg_entry_size; // 42-23
+ unsigned short prg_entry_count; // 44-45
+ unsigned short sec_entry_size; // 46-47
+ unsigned short sec_entry_count; // 48-49
+ unsigned short sec_names_index; // 50-51
+
+} ELF_HEADER;
+
+typedef struct {
+ unsigned int seg_type;
+ unsigned int p_offset;
+ unsigned int p_vaddr;
+ unsigned int undefined;
+ unsigned int p_filesz;
+ unsigned int p_memsz;
+ unsigned int flags;
+ unsigned int alignment;
+} PRG_HEADER;
+
+#pragma pack(pop)
+
+#endif /* _ELF_H */ \ No newline at end of file