From owner-freebsd-hackers Fri Jan 5 18:00:19 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id SAA17080 for hackers-outgoing; Fri, 5 Jan 1996 18:00:19 -0800 (PST) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id SAA17075 Fri, 5 Jan 1996 18:00:14 -0800 (PST) Received: (from jdp@localhost) by austin.polstra.com (8.6.12/8.6.12) id SAA03676; Fri, 5 Jan 1996 18:00:10 -0800 Date: Fri, 5 Jan 1996 18:00:10 -0800 From: John Polstra Message-Id: <199601060200.SAA03676@austin.polstra.com> To: hasty@rah.star-gate.com Subject: Re: Anyone got GNU `dld' ported to FreeBSD? Newsgroups: polstra.freebsd.hackers In-Reply-To: <199601041943.LAA05776@rah.star-gate.com> Organization: Polstra & Co., Seattle, WA Cc: freebsd-hackers@freebsd.org, jkh@freebsd.org Sender: owner-hackers@freebsd.org Precedence: bulk In article <199601041943.LAA05776@rah.star-gate.com> Amancio writes: > >>> "Jordan K. Hubbard" said: > > Ours works just fine too, but I can't use dynamic linking from a > > statically-linked application, which is what sysinstall needs to be. > > What is your problem exactly when you try to use dlopen in a statically > compiled program? The dlopen and related functions are implemented in the dynamic linker, /usr/libexec/ld.so. The dynamic linker is itself a shared library. It is mapped into the address space (i.e., it is made available) only for dynamically-linked programs. So if your program is statically linked, it does not have access to the dl* functions. This is exactly the same behavior as SVR4 and SunOS, by the way. Also, a few people referred to the "static crt0.o" and the "dynamic crt0.o". There is only one crt0.o. It decides whether or not to invoke the dynamic linker, according to whether the program being run is dynamically linked. I suppose it might be possible to add support for the dl* functions into the static libc.a. I haven't thought through the ramifications of that. -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth