Changeset ,96
- Timestamp:
- 10/31/2008 09:29:09 PM (2 months ago)
- branch-nick:
- bzr
- Files:
-
- vesper/src/ELF.h (modified) (16 diffs)
- vesper/src/ElfParser.cpp (modified) (4 diffs)
- vesper/src/ElfParser.h (modified) (6 diffs)
- vesper/src/Globals.cpp (modified) (2 diffs)
- vesper/src/Globals.h (modified) (1 diff)
- vesper/src/Kernel.cpp (modified) (2 diffs)
- vesper/src/boot/Multiboot.cpp (modified) (2 diffs)
- vesper/src/boot/Multiboot.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
vesper/src/ELF.h
r94 r96 5 5 // (See file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt) 6 6 // 7 /* 8 * ELF file format structures definitions 9 * According to Portable Formats Specification, version 1.1 10 * (FIXME: update to 1.2) 11 * 12 * Typed in by Stanislav Karchebny <berkus+os@madfire.net>, 2001 13 * This file is in Public Domain. 14 */ 15 7 // 8 // ELF file format structure definitions. 9 // According to Portable Formats Specification, version 1.1 10 // (FIXME: update to 1.2) 11 // 16 12 #pragma once 17 13 … … 22 18 * ELF data types 23 19 */ 24 typedef uint32_t Elf32_Addr; /* 4 bytes/4 align/unsigned */25 typedef uint16_t Elf32_Half; /* 2 bytes/2 align/unsigned */26 typedef uint32_t Elf32_Off; /* 4 bytes/4 align/unsigned */27 typedef int32_t Elf32_Sword; /* 4 bytes/4 align/signed */28 typedef uint32_t Elf32_Word; /* 4 bytes/4 align/unsigned */29 typedef uint8_t Elf32_Byte; /* 1 byte /1 align/unsigned */20 typedef uint32_t elf32_addr_t; /* 4 bytes/4 align/unsigned */ 21 typedef uint16_t elf32_half_t; /* 2 bytes/2 align/unsigned */ 22 typedef uint32_t elf32_off_t; /* 4 bytes/4 align/unsigned */ 23 typedef int32_t elf32_sword_t; /* 4 bytes/4 align/signed */ 24 typedef uint32_t elf32_word_t; /* 4 bytes/4 align/unsigned */ 25 typedef uint8_t elf32_byte_t; /* 1 byte /1 align/unsigned */ 30 26 31 27 … … 33 29 * ELF structures: ELF file Header 34 30 */ 35 struct Elf32Header36 { 37 Elf32_Worde_magic;38 Elf32_Bytee_class;39 Elf32_Bytee_data;40 Elf32_Bytee_hdrversion;41 Elf32_Bytee_padding[9];42 Elf32_Halfe_type; /**< Identifies object file type */43 Elf32_Halfe_machine; /**< Specifies required architecture */44 Elf32_Worde_version; /**< Identifies object file version */45 Elf32_Addre_entry; /**< Entry point virtual address */46 Elf32_Offe_phoff; /**< Program header table file offset */47 Elf32_Offe_shoff; /**< Section header table file offset */48 Elf32_Worde_flags; /**< Processor-specific flags */49 Elf32_Halfe_ehsize; /**< ELF header size in bytes */50 Elf32_Halfe_phentsize; /**< Program header table entry size */51 Elf32_Halfe_phnum; /**< Program header table entry count */52 Elf32_Halfe_shentsize; /**< Section header table entry size */53 Elf32_Halfe_shnum; /**< Section header table entry count */54 Elf32_Halfe_shstrndx; /**< Section header string table index */31 struct elf32_header 32 { 33 elf32_word_t e_magic; 34 elf32_byte_t e_class; 35 elf32_byte_t e_data; 36 elf32_byte_t e_hdrversion; 37 elf32_byte_t e_padding[9]; 38 elf32_half_t e_type; /**< Identifies object file type */ 39 elf32_half_t e_machine; /**< Specifies required architecture */ 40 elf32_word_t e_version; /**< Identifies object file version */ 41 elf32_addr_t e_entry; /**< Entry point virtual address */ 42 elf32_off_t e_phoff; /**< Program header table file offset */ 43 elf32_off_t e_shoff; /**< Section header table file offset */ 44 elf32_word_t e_flags; /**< Processor-specific flags */ 45 elf32_half_t e_ehsize; /**< ELF header size in bytes */ 46 elf32_half_t e_phentsize; /**< Program header table entry size */ 47 elf32_half_t e_phnum; /**< Program header table entry count */ 48 elf32_half_t e_shentsize; /**< Section header table entry size */ 49 elf32_half_t e_shnum; /**< Section header table entry count */ 50 elf32_half_t e_shstrndx; /**< Section header string table index */ 55 51 } PACKED; 56 52 57 /* Elf32Header.e_magic */53 /* elf32_header.e_magic */ 58 54 #define ELF_MAGIC 0x464c457f /* ASCII "ELF",0x7F */ 59 55 60 /* Elf32Header.e_class */56 /* elf32_header.e_class */ 61 57 #define ELF_CLASS_NONE 0x00 /**< Invalid class */ 62 58 #define ELF_CLASS_32 0x01 /**< 32 bit objects */ 63 59 #define ELF_CLASS_64 0x02 /**< 64 bit objects */ 64 60 65 /* Elf32Header.e_data */61 /* elf32_header.e_data */ 66 62 #define ELF_DATA_NONE 0x00 /**< Invalid data encoding */ 67 63 #define ELF_DATA_2LSB 0x01 /**< LSB (Intel) encoding */ 68 64 #define ELF_DATA_2MSB 0x02 /**< MSB (Motorola) encoding */ 69 65 70 /* Elf32Header.e_type */66 /* elf32_header.e_type */ 71 67 #define ET_NONE 0x0000 /* No type */ 72 68 #define ET_REL 0x0001 /* Relocatable */ … … 74 70 #define ET_DYN 0x0003 /* Shared */ 75 71 #define ET_CORE 0x0004 /* Core */ 76 #define ET_LOPROC 0xff00 72 #define ET_LOPROC 0xff00 /* Processor-specific */ 77 73 #define ET_HIPROC 0xffff 78 74 79 /* Elf32Header.e_machine */75 /* elf32_header.e_machine */ 80 76 #define EM_NONE 0x0000 /* No machine */ 81 77 #define EM_M32 0x0001 /* AT&T WE32100 */ … … 87 83 #define EM_MIPS 0x0008 /* MIPS RS3000 */ 88 84 89 /* Elf32Header.e_version */85 /* elf32_header.e_version */ 90 86 #define EV_NONE 0 /* Invalid version */ 91 87 #define EV_CURRENT 1 /* Current version */ … … 95 91 * ELF structures: Section header 96 92 */ 97 struct Elf32SectionHeader98 { 99 Elf32_Wordsh_name; /**< Section name, index in string table */100 Elf32_Wordsh_type; /**< Type of section */101 Elf32_Wordsh_flags; /**< Miscellaneous section attributes */102 Elf32_Addrsh_addr; /**< Section virtual addr at execution */103 Elf32_Offsh_offset; /**< Section file offset */104 Elf32_Wordsh_size; /**< Size of section in bytes */105 Elf32_Wordsh_link; /**< Index of another section */106 Elf32_Wordsh_info; /**< Additional section information */107 Elf32_Wordsh_addralign; /**< Section alignment */108 Elf32_Wordsh_entsize; /**< Entry size if section holds table */93 struct elf32_section_header 94 { 95 elf32_word_t sh_name; /**< Section name, index in string table */ 96 elf32_word_t sh_type; /**< Type of section */ 97 elf32_word_t sh_flags; /**< Miscellaneous section attributes */ 98 elf32_addr_t sh_addr; /**< Section virtual addr at execution */ 99 elf32_off_t sh_offset; /**< Section file offset */ 100 elf32_word_t sh_size; /**< Size of section in bytes */ 101 elf32_word_t sh_link; /**< Index of another section */ 102 elf32_word_t sh_info; /**< Additional section information */ 103 elf32_word_t sh_addralign; /**< Section alignment */ 104 elf32_word_t sh_entsize; /**< Entry size if section holds table */ 109 105 } PACKED; 110 106 … … 118 114 #define SHN_HIRESERVE 0xffff 119 115 120 /* Elf32SectionHeader.sh_type */116 /* elf32_section_header.sh_type */ 121 117 #define SHT_NULL 0x00000000 122 118 #define SHT_PROGBITS 0x00000001 /* The data is contained in program file */ … … 141 137 142 138 143 /* Elf32SectionHeader.sh_flags */139 /* elf32_section_header.sh_flags */ 144 140 #define SHF_WRITE 0x00000001 145 141 #define SHF_ALLOC 0x00000002 … … 151 147 * ELF structures: Symbol Table 152 148 */ 153 struct Elf32Symbol154 { 155 Elf32_Wordst_name; /**< Symbol name, index into string table */156 Elf32_Addrst_value; /**< Symbol value */157 Elf32_Wordst_size; /**< Size occupied by this symbol */158 Elf32_Bytest_info; /**< Symbol type and binding */159 Elf32_Bytest_other;160 Elf32_Halfst_shndx; /**< Section index this symbol belongs to */149 struct elf32_symbol 150 { 151 elf32_word_t st_name; /**< Symbol name, index into string table */ 152 elf32_addr_t st_value; /**< Symbol value */ 153 elf32_word_t st_size; /**< Size occupied by this symbol */ 154 elf32_byte_t st_info; /**< Symbol type and binding */ 155 elf32_byte_t st_other; 156 elf32_half_t st_shndx; /**< Section index this symbol belongs to */ 161 157 } PACKED; 162 158 … … 164 160 #define STN_UNDEF 0x0000 165 161 166 /* Elf32Symbol.st_info manipulation macros */162 /* elf32_symbol.st_info manipulation macros */ 167 163 #define ELF32_ST_BIND(i) ((i) >> 4) 168 164 #define ELF32_ST_TYPE(i) ((i) & 0xf) 169 165 #define ELF32_ST_INFO(b,t) ((b) << 4 + ((t) & 0xf)) 170 166 171 /* ELF32_ST_BIND( Elf32Symbol.st_info) values */167 /* ELF32_ST_BIND(elf32_symbol.st_info) values */ 172 168 #define STB_LOCAL 0x0 173 169 #define STB_GLOBAL 0x1 … … 176 172 #define STB_HIPROC 0xf 177 173 178 /* ELF32_ST_TYPE( Elf32Symbol.st_info) values */174 /* ELF32_ST_TYPE(elf32_symbol.st_info) values */ 179 175 #define STT_NOTYPE 0x0 180 176 #define STT_OBJECT 0x1 … … 189 185 * ELF structures: Dynamic linking info 190 186 */ 191 struct Elf32Dyn192 { 193 Elf32_Swordd_tag;194 union195 {196 Elf32_Wordd_val;197 Elf32_Addrd_ptr;198 } d_un;187 struct elf32_dyn 188 { 189 elf32_sword_t d_tag; 190 union 191 { 192 elf32_word_t d_val; 193 elf32_addr_t d_ptr; 194 } d_un; 199 195 }; 200 196 201 /* Elf32Dyn.d_tag */197 /* elf32_dyn.d_tag */ 202 198 #define DT_NULL 0x00000000 203 199 #define DT_NEEDED 0x00000001 … … 231 227 * ELF structures: Relocation Entries 232 228 */ 233 struct Elf32_Rel234 { 235 Elf32_Addrr_offset;236 Elf32_Wordr_info;229 struct elf32_rel 230 { 231 elf32_addr_t r_offset; 232 elf32_word_t r_info; 237 233 }; 238 234 239 struct Elf32_Rela240 { 241 Elf32_Addrr_offset;242 Elf32_Wordr_info;243 Elf32_Swordr_addend;235 struct elf32_rela 236 { 237 elf32_addr_t r_offset; 238 elf32_word_t r_info; 239 elf32_sword_t r_addend; 244 240 }; 245 241 246 /* Elf32_Rel|a.r_info manipulation macros */242 /* elf32_rel|a.r_info manipulation macros */ 247 243 #define ELF32_R_SYM(i) ((i) >> 8) 248 244 #define ELF32_R_TYPE(i) ((i) & 0xff) 249 245 #define ELF32_R_INFO(s,t) ((s) << 8 + (t) & 0xff) 250 246 251 /* ELF32_R_TYPE( Elf32_Rel|a.r_info) values */247 /* ELF32_R_TYPE(elf32_rel|a.r_info) values */ 252 248 #define R_386_NONE 0x00 253 249 #define R_386_32 0x01 … … 266 262 * ELF structures: Program Header 267 263 */ 268 struct Elf32ProgramHeader269 { 270 Elf32_Wordp_type; /**< Program section type */271 Elf32_Offp_offset; /**< File offset */272 Elf32_Addrp_vaddr; /**< Execution virtual address */273 Elf32_Addrp_paddr; /**< Execution physical address */274 Elf32_Wordp_filesz; /**< Size in file */275 Elf32_Wordp_memsz; /**< Size in memory */276 Elf32_Wordp_flags; /**< Section flags */277 Elf32_Wordp_align; /**< Section alignment */264 struct elf32_program_header 265 { 266 elf32_word_t p_type; /**< Program section type */ 267 elf32_off_t p_offset; /**< File offset */ 268 elf32_addr_t p_vaddr; /**< Execution virtual address */ 269 elf32_addr_t p_paddr; /**< Execution physical address */ 270 elf32_word_t p_filesz; /**< Size in file */ 271 elf32_word_t p_memsz; /**< Size in memory */ 272 elf32_word_t p_flags; /**< Section flags */ 273 elf32_word_t p_align; /**< Section alignment */ 278 274 }; 279 275 280 /* Elf32ProgramHeader.p_type */276 /* elf32_program_header.p_type */ 281 277 #define PT_NULL 0 282 278 #define PT_LOAD 1 … … 289 285 #define PT_HIPROC 0x7fffffff 290 286 291 /* Elf32ProgramHeader.p_flags */287 /* elf32_program_header.p_flags */ 292 288 #define PF_X 0x1 293 289 #define PF_W 0x2 … … 300 296 elf_hash(const unsigned char *name) 301 297 { 302 unsigned long h = 0, g;303 while (*name)304 {305 h = (h << 4) + *name++;306 if ((g = h & 0xf0000000))307 h ^= g >> 24;308 h &= ~g;309 }310 return h;298 unsigned long h = 0, g; 299 while (*name) 300 { 301 h = (h << 4) + *name++; 302 if ((g = h & 0xf0000000)) 303 h ^= g >> 24; 304 h &= ~g; 305 } 306 return h; 311 307 } 312 308 vesper/src/ElfParser.cpp
r94 r96 11 11 elf_parser::elf_parser() 12 12 { 13 header = NULL;14 section Headers = NULL;15 symbol Table = NULL;16 string Table = NULL;17 got Table = NULL;18 filename = NULL;13 header = NULL; 14 section_headers = NULL; 15 symbol_table = NULL; 16 string_table = NULL; 17 got_table = NULL; 18 filename = NULL; 19 19 } 20 20 … … 22 22 { 23 23 delete header; 24 delete section Headers;24 delete section_headers; 25 25 delete [] filename; 26 26 } 27 27 28 void elf_parser::load Kernel(Elf32SectionHeader* symtab,29 Elf32SectionHeader* strtab)28 void elf_parser::load_kernel(elf32_section_header* symtab, 29 elf32_section_header* strtab) 30 30 { 31 symbol Table = symtab;32 string Table = strtab;31 symbol_table = symtab; 32 string_table = strtab; 33 33 } 34 34 35 char* elf_parser::find Symbol(address_t addr, address_t *symbolStart)35 char* elf_parser::find_symbol(address_t addr, address_t *symbol_start) 36 36 { 37 37 address_t max = 0; 38 Elf32Symbol *fallbackSymbol = 0; 39 for (unsigned int i = 0; i < symbolTable->sh_size / symbolTable->sh_entsize; i++) 38 elf32_symbol *fallback_symbol = 0; 39 for (unsigned int i = 0; i < symbol_table->sh_size / 40 symbol_table->sh_entsize; i++) 40 41 { 41 Elf32Symbol *symbol = (Elf32Symbol *)(symbolTable->sh_addr + i * symbolTable->sh_entsize); 42 elf32_symbol *symbol = (elf32_symbol *)(symbol_table->sh_addr 43 + i * symbol_table->sh_entsize); 42 44 43 45 if ((addr >= symbol->st_value) && 44 46 (addr < symbol->st_value + symbol->st_size) ) 45 47 { 46 char *c = (char *)(symbol->st_name) + string Table->sh_addr;48 char *c = (char *)(symbol->st_name) + string_table->sh_addr; 47 49 48 if (symbol Start)50 if (symbol_start) 49 51 { 50 *symbol Start = symbol->st_value;52 *symbol_start = symbol->st_value; 51 53 } 52 54 return c; … … 56 58 { 57 59 max = symbol->st_value; 58 fallback Symbol = symbol;60 fallback_symbol = symbol; 59 61 } 60 62 } … … 62 64 // Search for symbol with size failed, now take a wild guess. 63 65 // Use a biggest symbol value less than addr (if found). 64 if (fallback Symbol)66 if (fallback_symbol) 65 67 { 66 char *c = (char *)(fallback Symbol->st_name) + stringTable->sh_addr;68 char *c = (char *)(fallback_symbol->st_name) + string_table->sh_addr; 67 69 68 if (symbol Start)70 if (symbol_start) 69 71 { 70 *symbol Start = fallbackSymbol->st_value;72 *symbol_start = fallback_symbol->st_value; 71 73 } 72 74 return c; 73 75 } 74 76 75 if (symbol Start)76 *symbol Start = 0;77 if (symbol_start) 78 *symbol_start = 0; 77 79 return NULL; 78 80 } vesper/src/ElfParser.h
r94 r96 36 36 * Writes all section information to the virtual memory image. 37 37 */ 38 void write AllSections();38 void write_all_sections(); 39 39 40 40 /** 41 41 * Returns the address of the last byte to be loaded in. 42 42 */ 43 address_t get LastAddress();43 address_t get_last_address(); 44 44 45 45 /** 46 46 * Loads the symbol table for the kernel from the specified location. 47 47 */ 48 void loadKernel(Elf32SectionHeader *symtab, Elf32SectionHeader *strtab); 48 void load_kernel(elf32_section_header* symtab, 49 elf32_section_header* strtab); 49 50 50 51 /** … … 52 53 * of that symbol in startAddr if startAddr != NULL. 53 54 */ 54 char* find Symbol(address_t addr, address_t *symbolStart = NULL);55 char* find_symbol(address_t addr, address_t *symbol_start = NULL); 55 56 56 57 /** … … 59 60 * using the hashtable sections in ELF. 60 61 */ 61 address_t find Symbol(char* str);62 address_t find_symbol(char* str); 62 63 63 64 /** … … 65 66 * relocation symbol table. 66 67 */ 67 address_t find DynamicSymbolLocation(address_t o);68 address_t find_dynamic_symbol_location(address_t o); 68 69 69 70 /** … … 71 72 * the symbol at offset o in the relocation symbol table. 72 73 */ 73 char *find DynamicSymbolName(address_t o);74 char *find_dynamic_symbol_name(address_t o); 74 75 75 76 /** 76 77 * Gets the address of the global offset table. 77 78 */ 78 address_t get GlobalOffsetTable();79 address_t get_global_offset_table(); 79 80 80 81 /** 81 82 * Returns the entry point of the executable. 82 83 */ 83 address_t get EntryPoint()84 address_t get_entry_point() 84 85 { 85 86 return (address_t)header->e_entry; … … 89 90 * Returns true if the parser loaded correctly. 90 91 */ 91 bool is Valid()92 bool is_valid() 92 93 { 93 return (filename !=0);94 return (filename != 0); 94 95 } 95 96 96 97 private: 97 Elf32Header *header;98 Elf32SectionHeader *symbolTable;99 Elf32SectionHeader *stringTable;100 Elf32SectionHeader *gotTable; // Global offset table.101 Elf32SectionHeader *relTable;102 Elf32SectionHeader *sectionHeaders;103 const char *filename;98 elf32_header* header; 99 elf32_section_header* symbol_table; 100 elf32_section_header* string_table; 101 elf32_section_header* got_table; // Global offset table. 102 elf32_section_header* rel_table; 103 elf32_section_header* section_headers; 104 const char* filename; 104 105 }; 105 106 vesper/src/Globals.cpp
r94 r96 16 16 /* Global objects FIXME: use singletons instead? */ 17 17 class kernel kernel; 18 multiboot_t multiboot;18 class multiboot multiboot; 19 19 elf_parser kernelElfParser; 20 20 MemoryManager memoryManager; … … 22 22 23 23 /* This entry point is called from loader */ 24 void kernel_entry(multiboot_header _t*multiboot_header)24 void kernel_entry(multiboot_header *multiboot_header) 25 25 { 26 26 kconsole.clear(); 27 multiboot = multiboot _t(multiboot_header);27 multiboot = multiboot::multiboot(multiboot_header); 28 28 kernel.run(); /* does not return */ 29 29 } vesper/src/Globals.h
r94 r96 12 12 13 13 extern class kernel kernel; 14 extern class multiboot _tmultiboot;14 extern class multiboot multiboot; 15 15 extern class elf_parser kernelElfParser; 16 16 extern class MemoryManager memoryManager; 17 17 extern class InterruptDescriptorTable interruptsTable; 18 18 19 extern "C" void kernel_entry(class multiboot_header _t*mh) NORETURN;19 extern "C" void kernel_entry(class multiboot_header *mh) NORETURN; 20 20 21 21 void *operator new(size_t size); vesper/src/Kernel.cpp
r94 r96 28 28 relocate_placement_address(); 29 29 30 kernelElfParser.loadKernel(multiboot.symtab_start(), multiboot.strtab_start()); 30 kernelElfParser.load_kernel(multiboot.symtab_start(), 31 multiboot.strtab_start()); 31 32 32 33 GlobalDescriptorTable::init(); … … 155 156 ebp = backtrace(ebp, eip); 156 157 unsigned int offset; 157 char *symbol = kernelElfParser.find Symbol(eip, &offset);158 char *symbol = kernelElfParser.find_symbol(eip, &offset); 158 159 offset = eip - offset; 159 160 kconsole.print("| %08x <%s+0x%x>\n", eip, symbol ? symbol : "UNRESOLVED", offset); vesper/src/boot/Multiboot.cpp
r95 r96 10 10 #include "ELF.h" 11 11 12 multiboot _t::multiboot_t(multiboot_header_t*h)12 multiboot::multiboot(multiboot_header *h) 13 13 { 14 14 header = h; … … 18 18 19 19 // try and find the symtab/strtab 20 if (is_elf()) 21 { 22 Elf32SectionHeader *shstrtab = (Elf32SectionHeader *)(header->addr + header->shndx * header->size); 23 // loop through the section headers, try to find the symbol table. 24 for(uint32_t i = 0; i < header->num; i++) 25 { 26 Elf32SectionHeader *sh = (Elf32SectionHeader *)(header->addr + i * header->size); 20 if (!is_elf()) 21 return; 27 22 28 if (sh->sh_type == SHT_SYMTAB) 29 { 30 symtab = sh; 31 } 32 else if (sh->sh_type == SHT_STRTAB) 33 { 34 char *c = (char *)shstrtab->sh_addr + sh->sh_name; 35 if (string::equals(c, ".strtab")) 36 { 37 strtab = sh; 38 } 39 } 40 } 41 } 23 elf32_section_header* shstrtab = (elf32_section_header*)(header->addr + 24 header->shndx * header->size); 25 // loop through the section headers, try to find the symbol table. 26 for(uint32_t i = 0; i < header->num; i++) 27 { 28 elf32_section_header* sh = (elf32_section_header*)(header->addr + i * 29 header->size); 30 31 if (sh->sh_type == SHT_SYMTAB) 32 { 33 symtab = sh; 34 } 35 else if (sh->sh_type == SHT_STRTAB) 36 { 37 char *c = (char *)shstrtab->sh_addr + sh->sh_name; 38 if (string::equals(c, ".strtab")) 39 { 40 strtab = sh; 41 } 42 } 43 } 42 44 } 43 45 vesper/src/boot/Multiboot.h
r94 r96 27 27 * Boot information passed in by multiboot loader. 28 28 */ 29 struct multiboot_header _t29 struct multiboot_header 30 30 { 31 31 uint32_t flags; … … 70 70 * Defines an interface to the multiboot header 71 71 */ 72 class multiboot _t72 class multiboot 73 73 { 74 74 public: 75 multiboot _t() : header(NULL) {}76 multiboot _t(multiboot_header_t*h);75 multiboot() : header(NULL) {} 76 multiboot(multiboot_header *h); 77 77 78 78 INLINE uint32_t lower_mem() { return header->mem_lower; } … … 129 129 } 130 130 } 131 INLINE Elf32SectionHeader *symtab_start()131 INLINE elf32_section_header* symtab_start() 132 132 { 133 133 if (symtab) 134 134 { 135 return ( Elf32SectionHeader*)symtab;135 return (elf32_section_header*)symtab; 136 136 } 137 137 else … … 140 140 } 141 141 } 142 INLINE Elf32SectionHeader *strtab_start()142 INLINE elf32_section_header* strtab_start() 143 143 { 144 144 if (strtab) 145 145 { 146 return (Elf32SectionHeader*)strtab;146 return (elf32_section_header*)strtab; 147 147 } 148 148 else … … 156 156 157 157 private: 158 multiboot_header _t *header;159 Elf32SectionHeader *strtab;160 Elf32SectionHeader *symtab;158 multiboot_header* header; 159 elf32_section_header* strtab; 160 elf32_section_header* symtab; 161 161 }; 162 162
