Subject: Re: PTL2 (pkgsrc/devel/ptl2) doesn't work with i386/ELF
To: None <tech-pkg@netbsd.org>
From: None <k-abe@kuroneko.media.osaka-cu.ac.jp>
List: tech-kern
Date: 09/21/1999 11:41:48
From: Noriyuki Soda <soda@sra.co.jp>
Subject: Re: PTL2 (pkgsrc/devel/ptl2) doesn't work with i386/ELF
Date: Mon, 20 Sep 1999 23:11:19 +0900 (JST)
> PTL2 (pkgsrc/devel/pth2) doesn't work with i386/ELF.
> Environment: NetBSD-current 9/10 kernel + 8/10 userland
:
> what's wrong?
Hi, i'm the author of ptl2 :)
ptl2 uses interposition technique; ptl2 defines some functions like
read(), write(), ioctl(), etc. and these function call native (ie in
libc) functions. to do this, ptl2 use dlopen() and dlsym().
that is, ptl2 dlopen() the libc.so.XXX and dlsym() on it to
obtain the function address of these native functions.
But, i think NetBSD's ld.elf_so does not behave correctly.
it seems to me that dlsym() always returns ptl2's symbol, not libc's,
as reported in PR#5890.
soda> FreeBSD's rtld.c seems to fix the problem described in PR#5890 on it's
soda> revision 1.34 and 1.37.
soda> See http://www.freebsd.org/cgi/cvsweb.cgi/src/libexec/rtld-elf/rtld.c
I hope this will resolve the problem!
--
Kota Abe
Media Center, Osaka City Univ.