Subject: lib/24801: dlfcn(3), dlsym: RTLD_DEFAULT, RTLD_NEXT, RTLD_SELF not documented
To: None <gnats-bugs@gnats.NetBSD.org>
From: Richard Earnshaw <rearnsha@arm.com>
List: netbsd-bugs
Date: 03/16/2004 14:38:57
>Number:         24801
>Category:       lib
>Synopsis:       dlsym: RTLD_DEFAULT, RTLD_NEXT, RTLD_SELF not documented
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 16 14:41:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Richard Earnshaw
>Release:        NetBSD 1.6ZI
>Organization:
ARM
-- 
>Environment:
	
	
System: NetBSD shark1.cambridge.arm.com 1.6ZI NetBSD 1.6ZI (SHARK1-x) #0: Mon Feb 16 11:17:45 GMT 2004 rearnsha@pc960.cambridge.arm.com:/work/rearnsha/netbsd/build/src/shark/sys/arch/shark/compile/SHARK1-x shark
Architecture: arm
Machine: shark
>Description:
	

	The special handle arguments to dlsym, namely RTLD_DEFAULT, RTLD_NEXT
	and RTLD_SELF are not documented in dlfcn(3).  The absense of 
	RTLD_DEFAULT is particularly serious since this value implented the
	linux equivalent of searching the application itself.  Eg, the linux
	code:

	    root = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY);
	    lib = dlopen ("libm.so", RTLD_GLOBAL | RTLD_LAZY);
	    symbol = dlsym (root, "asin");

	has to be implemented as

	    lib = dlopen ("libm.so", RTLD_GLOBAL | RTLD_LAZY);
	    symbol = dlsym (RTLD_DEFAULT, "asin");
	
	on NetBSD.


>How-To-Repeat:
	
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted: