Subject: port-pmax/6817: dlsym() ignores handle argument
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mcmahill@mtl.mit.edu>
List: netbsd-bugs
Date: 01/15/1999 12:58:01
>Number:         6817
>Category:       port-pmax
>Synopsis:       dlsym() ignores handle argument
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-pmax-maintainer (NetBSD/pmax Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 15 10:05:00 1999
>Last-Modified:
>Originator:     Dan McMahill
>Organization:
	
>Release:        1.3.3
>Environment:
	
System: NetBSD sy-borg 1.3.3 NetBSD 1.3.3 (GENERIC) #0: Sat Dec 12 15:08:02 EST 1998 root@vlad:/usr/src/sys/arch/pmax/compile/GENERIC pmax


>Description:

hndl=dlopen("libname",DL_LAZY);
sym=dlsym(hndl,"entryname");

is broken.  dlsym is supposed to search the shared library referenced by hndl
as opened by dlopen() for the symbol name "entryname".  Instead, dlsym() searches
all currently opened libraries (not just "libname" as required).

	
>How-To-Repeat:

a short example program is at

http://www-mtl.mit.edu/~mcmahill/netbsd/bugs.tar

extract, then

make

2 libraries are loaded with the same symbol name in each.  with both open, I can only
find the 1st one.  when I close the first library, then I can find the second one.


	
>Fix:

fix dlsym().  I unfortunately don't know how.
	
>Audit-Trail:
>Unformatted: