From: Petar Jovanovic Date: Thu, 6 Oct 2016 17:46:14 +0000 (+0000) Subject: mips32: fix the wrong offset for mmap2() X-Git-Tag: svn/VALGRIND_3_13_0~355 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=296bd45ae0fb055d8ec11e32ce41f535ace59f7a;p=thirdparty%2Fvalgrind.git mips32: fix the wrong offset for mmap2() The offset for mmap2 is specified in 4096-byte units, not page size units. Patch by Duncan Palmer . It fixes BZ#352197. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16026 --- diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index d75583063a..b32e4cc776 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -530,7 +530,7 @@ DECL_TEMPLATE (mips_linux, sys_prctl); PRE(sys_mmap2) { - /* Exactly like sys_mmap() except the file offset is specified in pagesize + /* Exactly like sys_mmap() except the file offset is specified in 4096 byte units rather than bytes, so that it can be used for files bigger than 2^32 bytes. */ SysRes r; @@ -540,7 +540,7 @@ PRE(sys_mmap2) unsigned long, prot, unsigned long, flags, unsigned long, fd, unsigned long, offset); r = mips_PRE_sys_mmap(tid, ARG1, ARG2, ARG3, ARG4, ARG5, - VKI_PAGE_SIZE * (Off64T) ARG6); + 4096 * (Off64T) ARG6); SET_STATUS_from_SysRes(r); }