1 /*---------------------------------------------------------------------------* 2 Project: TwlSDK - bin2obj 3 File: object.h 4 5 Copyright 2005-2008 Nintendo. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Date:: 2008-09-18#$ 14 $Rev: 8573 $ 15 $Author: okubata_ryoma $ 16 *---------------------------------------------------------------------------*/ 17 #ifndef OBJECT_H__ 18 #define OBJECT_H__ 19 20 #include "types.h" 21 #include "elf.h" 22 23 typedef struct 24 { 25 u32 size; 26 u8 *ptr; 27 } 28 Section; 29 30 // Elf Header 31 //#define SIZE_ELFHEADER sizeof(ELF32_ElfHeader) 32 33 // Section List 34 #define MAX_SECTIONS 16 35 //#define SECTION_NULL 0 // index=0 section is dummy=NULL 36 //#define SECTION_SHSTRTAB 1 // index=1 section name table 37 //#define SECTION_SYMTAB 2 // index=2 symbol information structure 38 //#define SECTION_STRTAB 3 // index=3 symbol name table 39 //#define SECTION_DATA 4 // index=4 data section 40 41 // Symbol List 42 #define MAX_SYMBOLS 16 43 //#define SYMBOL_NULL 0 // index=0 symbol is dummy=NULL 44 //#define SYMBOL_LABEL_BEGIN 1 // index=1 starting position of the region 45 //#define SYMBOL_LABEL_END 2 // index=2 terminus position of the region 46 47 // Data Section 48 #define MAX_DATA 16 49 50 typedef struct 51 { 52 u32 index; 53 Section section; 54 55 } 56 DataSection; 57 58 59 // Object 60 typedef struct 61 { 62 // Elf Header 63 ELF32_ElfHeader header; 64 65 // Section Header 66 ELF32_SectionHeader section[MAX_SECTIONS]; 67 68 // Section String Section (.shstrtab) 69 Section section_name; 70 71 // Symbol Section (.symtab) 72 u32 symbol_index; 73 ELF32_Symbol symbol[MAX_SYMBOLS]; 74 75 // Symbol String Section (.strtab) 76 u32 symbol_name_index; 77 Section symbol_name; 78 79 // Data Section (.data) or (.rodata) 80 u32 num_data; 81 DataSection data[MAX_DATA]; 82 83 } 84 Object; 85 86 #endif //BIN2OBJ_H__ 87