Explicitly mprotect loaded code pages PROT_EXEC on x86 Linux, as FC3 now requires it. - gcl.git - GNU Common Lisp

index : gcl.git
GNU Common Lisp
summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamm Maguire <camm@debian.org>2005年01月13日 22:46:34 +0000
committerCamm Maguire <camm@debian.org>2005年01月13日 22:46:34 +0000
commit16cb9a4756967addbd00aa959d818a5bf3dd8ad2 (patch)
tree2728c4840498cf0d2ff3804c75ba6f00928f4cc6
parentc1e962780b84bd34864f6f45f93862d8dac56b9a (diff)
downloadgcl-unlabeled-1.12.6.1.10.tar.gz
Explicitly mprotect loaded code pages PROT_EXEC on x86 Linux, as FC3 now requires it.unlabeled-1.12.6.1.10
Diffstat
-rwxr-xr-xgcl/h/386-linux.h 15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcl/h/386-linux.h b/gcl/h/386-linux.h
index 4b62b5169..16ff5d26a 100755
--- a/gcl/h/386-linux.h
+++ b/gcl/h/386-linux.h
@@ -41,3 +41,18 @@
#define I386
#define SGC
+
+
+#ifdef IN_SFASL
+#include <sys/mman.h>
+#define CLEAR_CACHE {\
+ void *p,*pe; \
+ p=(void *)((unsigned long)memory->cfd.cfd_start & ~(PAGESIZE-1)); \
+ pe=(void *)((unsigned long)(memory->cfd.cfd_start+memory->cfd.cfd_size) & ~(PAGESIZE-1)) + PAGESIZE-1; \
+ if (mprotect(p,pe-p,PROT_READ|PROT_WRITE|PROT_EXEC)) {\
+ fprintf(stderr,"%p %p\n",p,pe);\
+ perror("");\
+ FEerror("Cannot mprotect", 0);\
+ }\
+}
+#endif
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月02日 09:17:00 +0000

AltStyle によって変換されたページ (->オリジナル) /