Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
triazo
/
kernel
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
3
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6c1ebf19
authored
Nov 22, 2015
by
triazo
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Define elf structures
parent
8e6f3660
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
src/elf.h
src/elf.h
View file @
6c1ebf19
...
@@ -11,4 +11,39 @@
...
@@ -11,4 +11,39 @@
extern
uint8_t
elf_hello
[]
asm
(
"_binary_hello_elf_start"
);
extern
uint8_t
elf_hello
[]
asm
(
"_binary_hello_elf_start"
);
typedef
struct
{
uint32_t
magic
;
// \x7FELF
uint8_t
word_size
;
// 32/64 bit
uint8_t
endianness
;
uint8_t
elf_version
;
uint8_t
os_abi
;
uint64_t
unused
;
uint16_t
relocatable
;
uint16_t
instruction_set
;
uint32_t
elf_version_b
;
void
*
program_entry_position
;
uint32_t
program_header_table_offset
;
uint32_t
section_header_table_offset
;
uint32_t
flags
;
// undefined in x86
uint16_t
header_size
;
uint16_t
program_header_entry_size
;
uint16_t
program_header_entry_count
;
uint16_t
section_header_entry_size
;
uint16_t
section_header_entry_count
;
uint16_t
section_header_name_index
;
}
elf_header
;
typedef
struct
{
uint32_t
segment_type
;
uint32_t
p_offset
;
// Offset in the elf file for this segment's data
void
*
p_vaddr
;
// Where this segment should be located in virtual memory
uint32_t
unused
;
uint32_t
file_segment_size
;
// Size of the segment in this file and in memory
uint32_t
memory_segment_size
;
uint32_t
flags
;
uint32_t
alignment
;
}
elf_program_header
;
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment