This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH] define RTLD_LOCAL
- From: "Yaakov (Cygwin/X)" <yselkowitz at users dot sourceforge dot net>
- To: cygwin-patches <cygwin-patches at cygwin dot com>
- Date: Sun, 08 Aug 2010 00:49:13 -0500
- Subject: [PATCH] define RTLD_LOCAL
POSIX requires RTLD_LOCAL to be defined in <dlfcn.h>[1]. While our
dlopen() does nothing with its second argument, portable software can
rightfully expect the definition to exist alongside the other RTLD_*
macros.
So why 0? POSIX states wrt dlopen()[2]:
> If neither RTLD_GLOBAL nor RTLD_LOCAL are specified, then the default
> behavior is unspecified.
On Linux, RTLD_LOCAL is the default behaviour[3], and hence is defined
as 0[4], therefore I have done the same here.
Patch attached. Since this doesn't actually do anything, I wasn't sure
if I should bump CYGWIN_VERSION_API_MINOR for this or not; I can
certainly do so before committing if desired.
Yaakov
[1] http://www.opengroup.org/onlinepubs/9699919799/basedefs/dlfcn.h.html
[2] http://www.opengroup.org/onlinepubs/9699919799/functions/dlopen.html
[3] http://linux.die.net/man/3/dlopen
[4] http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
2010-08-06 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* include/dlfcn.h (RTLD_LOCAL): Define.
Index: include/dlfcn.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/dlfcn.h,v
retrieving revision 1.3
diff -u -r1.3 dlfcn.h
--- include/dlfcn.h 14 Sep 2004 08:29:12 -0000 1.3
+++ include/dlfcn.h 7 Aug 2010 01:22:37 -0000
@@ -31,6 +31,7 @@
#define RTLD_DEFAULT NULL
/* valid values for mode argument to dlopen */
+#define RTLD_LOCAL 0 /* symbols in this dlopen'ed obj are not visible to other dlopen'ed objs */
#define RTLD_LAZY 1 /* lazy function call binding */
#define RTLD_NOW 2 /* immediate function call binding */
#define RTLD_GLOBAL 4 /* symbols in this dlopen'ed obj are visible to other dlopen'ed objs */