[boot] Don't double-load read-only program data

The bootloader's load_program was reproducing all loadable program
header sections into new pages. Now only do that for sections containing
BSS sections (eg, where file size and mem size do not match).
This commit is contained in:
Justin C. Miller
2021-07-25 23:13:08 -07:00
parent 0b2df134ce
commit b88cd1d41f
3 changed files with 24 additions and 26 deletions

View File

@@ -256,17 +256,14 @@ map_section(
{
using kernel::init::section_flags;
size_t pages = memory::bytes_to_pages(section.size);
map_pages(
args,
section.phys_addr,
section.virt_addr,
pages,
memory::bytes_to_pages(section.size),
has_flag(section.type, section_flags::write),
has_flag(section.type, section_flags::execute));
}
} // namespace paging
} // namespace boot