Skip to content
Snippets Groups Projects
Commit d62f9b68 authored by Ahmed Abd El Mawgood's avatar Ahmed Abd El Mawgood
Browse files

Fix regression in ld.so elf size calculation

In patch 1182d120, I mistakingly added
the size of the gap to the total size of the binary, which was not
accurate. As the size of the binary was calculate by subtracting the
upperbound from the lower bound, thus all gaps in the middle are taking
into account.
parent 8b7c45b3
No related branches found
No related tags found
No related merge requests found
......@@ -394,7 +394,7 @@ impl Linker {
};
if same_elf {
let addr = dso.as_ref().unwrap().base_addr;
let mut size = bounds.1;
let size = bounds.1;
// Fill the gaps i the binary
let mut ranges = Vec::new();
for ph in elf.program_headers.iter() {
......@@ -410,8 +410,6 @@ impl Linker {
let mut start = addr;
for (vaddr, vsize) in ranges.iter() {
if start < addr + vaddr {
let gap_size = addr + vaddr - start;
size += gap_size;
sys_mman::mmap(
start as *mut c_void,
addr + vaddr - start,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment