From: Tom Musta Date: Thu, 6 Nov 2014 19:43:13 +0000 (-0600) Subject: linux-user: Do not subtract offset from end address X-Git-Tag: v2.2.0-rc1~4^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccf661f827faf700b03a30076b5f944e8f787280;p=thirdparty%2Fqemu.git 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 Signed-off-by: Riku Voipio --- diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 84123baa58f..e2596a4201d 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -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; }