boot: use multiboot2 symbol table
This commit is contained in:
+11
-1
@@ -16,7 +16,7 @@ static size_t g_strtab_size = 0;
|
||||
static struct hash g_symtab_hash;
|
||||
|
||||
// Multiboot2-loaded sections are misaligned for some reason
|
||||
void ksym_set_multiboot2(struct multiboot_tag_elf_sections *tag) {
|
||||
static void ksym_set_multiboot2(struct multiboot_tag_elf_sections *tag) {
|
||||
kinfo("Loading kernel symbols\n");
|
||||
kinfo("%u section headers:\n", tag->num);
|
||||
size_t string_section_offset = tag->shndx * tag->entsize;
|
||||
@@ -61,6 +61,16 @@ void ksym_set_multiboot2(struct multiboot_tag_elf_sections *tag) {
|
||||
}
|
||||
}
|
||||
|
||||
void ksym_set(struct elf_sections *sections) {
|
||||
switch (sections->kind) {
|
||||
case KSYM_TABLE_MULTIBOOT2:
|
||||
ksym_set_multiboot2(sections->tables.multiboot2);
|
||||
break;
|
||||
default:
|
||||
__builtin_unreachable();
|
||||
}
|
||||
}
|
||||
|
||||
void ksym_set_tables(uintptr_t s0, uintptr_t s1, size_t z0, size_t z1) {
|
||||
Elf64_Sym *sym;
|
||||
Elf64_Word type, bind;
|
||||
|
||||
Reference in New Issue
Block a user