Quantcast

add PROT_READ to mmap to bigcode.c

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

add PROT_READ to mmap to bigcode.c

Petar Jovanovic
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

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers
Loading...