linux-user: Do not subtract offset from end address

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>
This commit is contained in:
Tom Musta 2014-11-06 13:43:13 -06:00 committed by Riku Voipio
parent 558c2c8ddf
commit ccf661f827
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}