multiboot2: Use correct section list copy for section loading
This commit is contained in:
parent
98977f7d22
commit
0a9148c8eb
@ -318,7 +318,7 @@ bool multiboot2_load(char *config, char* cmdline) {
|
|||||||
memcpy(tag->sections, kernel + section_hdr_info->section_offset, section_hdr_info->section_entry_size * section_hdr_info->num);
|
memcpy(tag->sections, kernel + section_hdr_info->section_offset, section_hdr_info->section_entry_size * section_hdr_info->num);
|
||||||
|
|
||||||
for (size_t i = 0; i < section_hdr_info->num; i++) {
|
for (size_t i = 0; i < section_hdr_info->num; i++) {
|
||||||
struct elf64_shdr *shdr = (void *)kernel + section_hdr_info->section_offset + i * section_hdr_info->section_entry_size;
|
struct elf64_shdr *shdr = (void *)tag->sections + section_hdr_info->section_offset + i * section_hdr_info->section_entry_size;
|
||||||
|
|
||||||
if (shdr->sh_addr != 0 || shdr->sh_size == 0) {
|
if (shdr->sh_addr != 0 || shdr->sh_size == 0) {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user