From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 9870 invoked from network); 11 Mar 1999 11:52:15 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 11 Mar 1999 11:52:15 -0000 Received: from voicenet.com (mail12.voicenet.com [207.103.0.6]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id GAA14949 for ; Thu, 11 Mar 1999 06:45:01 -0500 Received: (qmail 17479 invoked from network); 11 Mar 1999 11:44:59 -0000 Received: from rotary936-pri.voicenet.com (HELO voicenet.com) (209.71.52.36) by mail12.voicenet.com with SMTP; 11 Mar 1999 11:44:59 -0000 Sender: gat@mail.redhat.com Message-ID: <36E7AB88.6716E1F8@voicenet.com> Date: Thu, 11 Mar 1999 06:39:52 -0500 From: Uncle George Organization: big-endian X-Mailer: Mozilla 4.07 [en] (X11; I; Linux 2.0.36 i686) MIME-Version: 1.0 To: drepper@cygnus.com, axp-list@redhat.com Subject: dlopen() et al loads multiple copies of same shared lib Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit my cwd is /usr/JAVA/d/jsrc12a/build/genunix with LD_LIBRARY_PATH=lib/alpha/green_threads:lib/alpha/classic with a dlopen("/usr/JAVA/d/jsrc12a/build/genunix/lib/alpha/libjava_g.so", ... ) I am able to load up the expected "libjava_g.so" shared file. Later on there is a dlopen("/usr/JAVA/d/jsrc12a/build/genunix/lib/alpha/libzip_g.so", ... ) BUT there is a hitch. in libzip_g.so - there is a ref to libjava_g.so then the loader also loads in another copy if libjava_g.so. This copy is created from a composite of the LD_LIBRARY_PATH & the required share library. It opens "lib/alpha/green_threads/libjava_g.so", tries to match the names in the _dl_loaded table, but none of them match "/usr/JAVA/d/jsrc12a/build/genunix/lib/alpha/green_threads/libjava_g.so" - ergo 2 copies with gdb u get from an "info share" Program exited normally. (gdb) info share >From To Syms Read Shared Object Library 0x0000020000110000 0x0000020000233c70 Yes /usr/JAVA/d/jsrc12a/build/genunix/lib/alpha/green_threads/libhpi_g.so 0x0000020000234000 0x00000200003cd864 Yes /usr/JAVA/d/jsrc12a/build/genunix/lib/alpha/classic/libjvm_g.so 0x00000200003ce000 0x00000200004d4570 Yes /lib/libdl.so.2.1 0x00000200004d6000 0x00000200006ab098 Yes /lib/libc.so.6.1 0x00000200006ac000 0x00000200007b2a40 Yes /lib/libnsl.so.1.1 0x00000200007b4000 0x00000200008df790 Yes /lib/libm.so.6.1 0x0000020000000000 0x000002000010edd8 Yes /lib/ld-linux.so.2 0x00000200048e0000 0x0000020004a1d0b8 Yes /usr/JAVA/d/jsrc12a/build/genunix/lib/alpha/libjava_g.so <==== COPY 1 0x0000020004a1e000 0x0000020004b31ab8 Yes /usr/JAVA/d/jsrc12a/build/genunix/lib/alpha/libzip_g.so 0x0000020004b32000 0x0000020004c6f0b8 Yes /usr/JAVA/d/jsrc12a/build/genunix/lib/alpha/libjava_g.so <=====COPY 2 0x0000020004cb4000 0x0000020004dbeea0 Yes /lib/libnss_files.so.1.1 0x0000020004dc0000 0x0000020004f2cb60 Yes /usr/JAVA/d/jsrc12a/build/genunix/lib/alpha/libaudio_g.so I'd like to fix it, but i like my philosophy, and dont know what the current standards to searchorder/techniques are to the dlopen() et al. It would probably be good to match the library names absolutely, and maybe the paths to the shared libraries separately. gat