Discussion:
add PROT_READ to mmap to bigcode.c
(too old to reply)
Petar Jovanovic
2017-02-01 16:43:49 UTC
Permalink
Raw Message
Hi All,

I would like to add a minor change to bigcode.c test:

Index: perf/bigcode.c
===================================================================
--- perf/bigcode.c (revision 16216)
+++ perf/bigcode.c (working copy)
@@ -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);



The test is failing on some MIPS platforms, as PROT_READ is not allowed.
I guess that most of the platforms implement PROT_EXEC as
PROT_READ|PROT_EXEC, otherwise this would be failing on other systems
too.

Let me know if anyone objects or if I am missing something obvious.

Regards,
Petar

Loading...