aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index e6b6385..143fcc8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -54,8 +54,7 @@ fn load_program<T: memory::Mmu>(memory: &mut memory::Memory,
let start = elf.file_header().entry as isa::Address;
for p in elf.section_headers() {
- let name = elf.section_name(p);
- if name == ".text" || name == ".sdata" || name == ".rodata" {
+ if p.flags.0 & elfloader::elf::SHF_ALLOC.0 != 0 {
memory.write_segment(mmu, elf.section_data(p), p.addr as usize);
}
}