]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips32: fix the wrong offset for mmap2()
authorPetar Jovanovic <mips32r2@gmail.com>
Thu, 6 Oct 2016 17:46:14 +0000 (17:46 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Thu, 6 Oct 2016 17:46:14 +0000 (17:46 +0000)
The offset for mmap2 is specified in 4096-byte units, not page size
units.

Patch by Duncan Palmer <dpalmer@digisoft.tv>.

It fixes BZ#352197.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16026

coregrind/m_syswrap/syswrap-mips32-linux.c

index d75583063a58898b5c9cf4f567764aac6ac62394..b32e4cc77687186b84e25f0bcdbb3507cfc02c22 100644 (file)
@@ -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);
 }