Discussion:
Valgrind: r16218 - /trunk/perf/bigcode.c
(too old to reply)
s***@valgrind.org
2017-02-02 17:24:15 UTC
Permalink
Raw Message
Author: petarj
Date: Thu Feb 2 17:24:14 2017
New Revision: 16218

Log:
Add PROT_READ flag to mmap, as Valgrind needs to be able to read the
code before it executes it.

This fixes none/tests/bigcode on some MIPS platforms.

Modified:
trunk/perf/bigcode.c

Modified: trunk/perf/bigcode.c
==============================================================================
--- trunk/perf/bigcode.c (original)
+++ trunk/perf/bigcode.c Thu Feb 2 17:24:14 2017
@@ -75,7 +75,7 @@
printf("%d copies of f(), %d reps\n", n_fns, n_reps);

char* a = mmap(0, FN_SIZE * n_fns,
- PROT_EXEC|PROT_WRITE,
+ PROT_EXEC|PROT_WRITE|PROT_READ,
MAP_PRIVATE|MAP_ANONYMOUS, -1,0);
assert(a != (char*)MAP_FAILED);

Loading...