Skip to content

Commit

Permalink
linux-user: Do not subtract offset from end address
Browse files Browse the repository at this point in the history
When computing the upper address of a program segment, do not subtract the
offset from the virtual address; instead compute the sum of the virtual address
and the memory size.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
  • Loading branch information
Tom Musta authored and Riku Voipio committed Nov 11, 2014
1 parent 558c2c8 commit ccf661f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion linux-user/elfload.c
Expand Up @@ -1824,7 +1824,7 @@ static void load_elf_image(const char *image_name, int image_fd,
if (a < loaddr) {
loaddr = a;
}
a += phdr[i].p_memsz;
a = phdr[i].p_vaddr + phdr[i].p_memsz;
if (a > hiaddr) {
hiaddr = a;
}
Expand Down

0 comments on commit ccf661f

Please sign in to comment.