35 lines
1.9 KiB
Markdown
35 lines
1.9 KiB
Markdown
# section.h
|
|
|
|
Definitions needed to parse the elf section headers.
|
|
|
|
# `elf_section_type_E` - enum
|
|
- **Null** - These sections can be ignored
|
|
- **Program Data** - These link to segments, if I remember right
|
|
- **Symbol Table** - Here are all the executables' symbols stored
|
|
- **String Table** - Here are all strings stored
|
|
- **RelocationA** - Contains relocation information
|
|
- **Hash** - Symbol Table hash table
|
|
- **Dynamic Link** - This provides information for the dynamic linker
|
|
- **Note** - notes that were created by the compiler / toolchain
|
|
- **Nobits** - Nulled data like `.bss`
|
|
|
|
# `elf_section_T` - struct
|
|
|
|
| Name | Type | Description |
|
|
|-----------------|----------|-------------------------------------------------------------------|
|
|
| name_offset | uint32_t | The offset of the sections name in `.shstrtab` |
|
|
| type | uint32_t | The type of the section -> elf_section_type_E |
|
|
| flags | uint64_t | Sections attribute flags |
|
|
| virtual_address | uint64_t | The address where the section should be mapped to (if it's not 0) |
|
|
| offset | uint64_t | The sections offset in the file |
|
|
| length | uint64_t | The size of the section |
|
|
| link | uint32_t | Type specific link to another section |
|
|
| info | uint32_t | Type specific information |
|
|
| alignment | uint64_t | If the section is aligned, this value specifies the alignment |
|
|
| entry_size | uint64_t | The size of the sections entries |
|
|
|
|
|
|
# `g_elf_section_type_strings` - global variable
|
|
An array of strings matching elf_section_type_E.
|
|
|