[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user