From owner-freebsd-questions Thu May 18 14:32:22 2000 Delivered-To: freebsd-questions@freebsd.org Received: from spoon.beta.com (h00a0242f177e.ne.mediaone.net [24.147.249.166]) by hub.freebsd.org (Postfix) with ESMTP id 1240237BA31 for ; Thu, 18 May 2000 14:32:18 -0700 (PDT) (envelope-from mcgovern@spoon.beta.com) Received: from spoon.beta.com (mcgovern@localhost.beta.com [127.0.0.1]) by spoon.beta.com (8.9.3/8.9.3) with ESMTP id QAA82814 for ; Thu, 18 May 2000 16:51:26 -0400 (EDT) (envelope-from mcgovern@spoon.beta.com) Message-Id: <200005182051.QAA82814@spoon.beta.com> To: questions@freebsd.org Subject: Accessing [non dynamic] symbols in shared library/_init and _fini Date: Thu, 18 May 2000 16:51:25 -0400 From: "Brian J. McGovern" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I've just starting playing with dlopen() and family. So far, I've got it opening up libraries and using the functions contained therein. The functions in the dynamic library use stdio routines, such as printf() without problems. The issue, simply, is that I'm clueless about the mechanics. The next thing I'd like to do is be able to call a function thats not shared, but linked in to the main program. This comes back as an undefined symbol. Secondly, i'm currently compiling the libraries simply as: cc -shared -o foo.so foo.c It there anything I should add/change/etc? Also, I've been reading a few of the man pages, and it seems that ld handles calling _init and _fini at program startup and shutdown. I was curious if something similar is automatically done for shared libraries that are loaded? I'd like to have some initialization done without having to poke the user of the library to have to do it. Suggestions? -Brian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message