Changeset 157
- Timestamp:
- Jul 7, 2017, 1:48:48 PM (7 years ago)
- Location:
- trunk/kernel/libk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/elf.c
r156 r157 46 46 && ((header->e_machine == EM_MIPS) || 47 47 (header->e_machine == EM_MIPS_RS3_LE) || 48 (header->e_machine == EM_ 386))48 (header->e_machine == EM_X86_64)) 49 49 && (header->e_type == ET_EXEC)) 50 50 return true; … … 64 64 if( (header->e_machine == EM_MIPS) || 65 65 (header->e_machine == EM_MIPS_RS3_LE) || 66 (header->e_machine == EM_ 386) )67 printk("\n[ERROR] in %s : unexpected core / accept only MIPS or 80386\n", __FUNCTION__ );66 (header->e_machine == EM_X86_64) ) 67 printk("\n[ERROR] in %s : unexpected core / accept only MIPS or x86_64\n", __FUNCTION__ ); 68 68 69 69 if( header->e_type == ET_EXEC ) -
trunk/kernel/libk/elf.h
r156 r157 24 24 #include <hal_types.h> 25 25 26 /* Standard ELF types. */ 26 /* 27 * Standard ELF types. 28 */ 27 29 28 /* Type for a 16-bit quantity. 30 /* Type for a 16-bit quantity. */ 29 31 typedef uint16_t Elf32_Half; 30 32 31 /* Types for signed and unsigned 32-bit quantities. 33 /* Types for signed and unsigned 32-bit quantities. */ 32 34 typedef uint32_t Elf32_Word; 33 35 typedef int32_t Elf32_Sword; 34 36 35 /* Types for signed and unsigned 64-bit quantities. */ 36 typedef uint64_t Elf32_Xword; 37 typedef int64_t Elf32_Sxword; 38 39 /* Type of addresses. */ 37 /* Type of addresses. */ 40 38 typedef uint32_t Elf32_Addr; 41 39 42 /* Type of file offsets. 40 /* Type of file offsets. */ 43 41 typedef uint32_t Elf32_Off; 44 42 45 /* Type for section indices, which are 16-bit quantities. 43 /* Type for section indices, which are 16-bit quantities. */ 46 44 typedef uint16_t Elf32_Section; 47 45 48 /* Type for version symbol information. 46 /* Type for version symbol information. */ 49 47 typedef Elf32_Half Elf32_Versym; 50 48 … … 74 72 Elf32_Ehdr; 75 73 76 /* Fields in the e_ident array. The EI_* macros are indices into the 77 array. The macros under each EI_* macro are the values the byte 78 may have. */ 79 74 /* 75 * Fields in the e_ident array. The EI_* macros are indices into the 76 * array. The macros under each EI_* macro are the values the byte 77 * may have. 78 */ 80 79 #define EI_MAG0 0 /* File identification byte 0 index */ 81 80 #define ELFMAG0 0x7f /* Magic number byte 0 */ … … 89 88 #define EI_MAG3 3 /* File identification byte 3 index */ 90 89 #define ELFMAG3 'F' /* Magic number byte 3 */ 91 92 90 93 91 #define EI_CLASS 4 /* File class byte index */ … … 109 107 110 108 /* Legal values for e_type (object file type). */ 111 112 109 #define ET_NONE 0 /* No file type */ 113 110 #define ET_REL 1 /* Relocatable file */ … … 122 119 123 120 /* Legal values for e_machine (architecture). */ 124 125 121 #define EM_NONE 0 /* No machine */ 126 #define EM_386 3 /* Intel 80386 */127 #define EM_860 7 /* Intel 80860 */128 122 #define EM_MIPS 8 /* MIPS R3000 big-endian */ 129 123 #define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */ … … 131 125 #define EM_PPC64 21 /* PowerPC 64-bit */ 132 126 #define EM_ARM 40 /* ARM */ 127 #define EM_X86_64 62 /* AMD x86-64 architecture */ 133 128 134 129 /* Legal values for e_version (version). */ 135 136 130 #define EV_NONE 0 /* Invalid ELF version */ 137 131 #define EV_CURRENT 1 /* Current version */ … … 154 148 155 149 /* Legal values for p_type (segment type). */ 156 157 150 #define PT_NULL 0 /* Program header table entry unused */ 158 151 #define PT_LOAD 1 /* Loadable program segment */ … … 177 170 178 171 /* Legal values for p_flags (segment flags). */ 179 180 172 #define PF_X (1 << 0) /* Segment is executable */ 181 173 #define PF_W (1 << 1) /* Segment is writable */ … … 183 175 #define PF_MASKOS 0x0ff00000 /* OS-specific */ 184 176 #define PF_MASKPROC 0xf0000000 /* Processor-specific */ 185 186 177 187 178
Note: See TracChangeset
for help on using the changeset viewer.