From owner-freebsd-questions Thu May 18 19: 2:40 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 D47E337B60C for ; Thu, 18 May 2000 19:02:28 -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 WAA83948; Thu, 18 May 2000 22:02:12 -0400 (EDT) (envelope-from mcgovern@spoon.beta.com) Message-Id: <200005190202.WAA83948@spoon.beta.com> To: Alfred Perlstein Cc: "Brian J. McGovern" , questions@FreeBSD.ORG, mcgovern@spoon.beta.com Subject: Re: Accessing [non dynamic] symbols in shared library/_init and _fini In-reply-to: Your message of "Thu, 18 May 2000 15:29:12 PDT." <20000518152912.F21508@fw.wintelcom.net> Date: Thu, 18 May 2000 22:02:12 -0400 From: "Brian J. McGovern" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [snip] > You'll need to link with -export-dynamic for your main program's > symbols to be visible. Yup. Was right in the man page, and I went right over it (NOTES section). > For shared libraries initilization at link time you'll have to look > harder, I found it once but I can't remeber how to do it. I looked harder. Again, its in the man page, but I wasn't interpreting the errors correctly. _init() and _fini() can be in the library, and they're called when loaded/unloaded. You just have to link with -nostdlib to get rid of the crt0 definitions. Now everything is working like a charm :) -Brian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message