From owner-freebsd-current Tue Sep 1 21:37:01 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA04303 for freebsd-current-outgoing; Tue, 1 Sep 1998 21:37:01 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA04256 for ; Tue, 1 Sep 1998 21:36:46 -0700 (PDT) (envelope-from jdp@austin.polstra.com) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.8.8/8.8.8) with ESMTP id VAA18125; Tue, 1 Sep 1998 21:35:33 -0700 (PDT) (envelope-from jdp) Message-Id: <199809020435.VAA18125@austin.polstra.com> To: Mike Smith cc: chuckr@glue.umd.edu, current@FreeBSD.ORG Subject: Re: E-day problems: rtld-elf dlsym() broken? In-reply-to: Your message of "Tue, 01 Sep 1998 21:24:13 -0000." <199809012124.VAA00386@word.smith.net.au> Date: Tue, 01 Sep 1998 21:35:33 -0700 From: John Polstra Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Given that the goal here seems to be able to use dlopen to load > modules into an otherwise self-contained executable, would it be > more correct to suggest that the executable should be linked shared, > but against a static copy of the C library? I don't think that will work either, in general. The trouble is, when you link against a static library, only the modules actually used by the program are linked in. The other ones don't appear in the linked program at all. If you dlopen a shared object that needs some additional libc functions, it won't be able to find them. You might be able to work around it by linking the executable with "--whole-archive" to the linker, or some such nonsense. But that would make your executable very large. > If this is correct, what's the "polite" way to explicitly reference > libc? If you dlopen "libc.so.3" (a name without any slash characters) then the dynamic linker will search in all the usual places. That's the politest way I can think of. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message