summaryrefslogtreecommitdiffstats
path: root/byterun/unix.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2006-09-28 21:36:38 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2006-09-28 21:36:38 +0000
commitb0041ea9631ec5938bd7931128be484bd1a00bd3 (patch)
treec6cef2329b36f75240f8e5d01e296e7e69d5ca98 /byterun/unix.c
parent665b2d65b1fa59f30811a40063b4bbbe0b9214e0 (diff)
Revised DLL loading: distinguish between loading for execution
(ocamlrun, dynlink, toplevel) and loading for checking the existence of symbols (ocamlc). This is needed for Windows with manifests and not a bad idea for other platforms. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7656 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/unix.c')
-rw-r--r--byterun/unix.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/byterun/unix.c b/byterun/unix.c
index 7bb986008..def4f152c 100644
--- a/byterun/unix.c
+++ b/byterun/unix.c
@@ -199,7 +199,7 @@ entry_t *caml_lookup_bundle(const char *name)
return current;
}
-void * caml_dlopen(char * libname)
+void * caml_dlopen(char * libname, int for_execution)
{
NSObjectFileImage image;
entry_t *bentry = caml_lookup_bundle(libname);
@@ -283,9 +283,12 @@ char * caml_dlerror(void)
#define RTLD_NODELETE 0
#endif
-void * caml_dlopen(char * libname)
+void * caml_dlopen(char * libname, int for_execution)
{
- return dlopen(libname, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE);
+ return dlopen(libname,
+ for_execution
+ ? RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE
+ : RTLD_LAZY);
}
void caml_dlclose(void * handle)