From owner-freebsd-hackers Wed Dec 19 12:46:29 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by hub.freebsd.org (Postfix) with ESMTP id A85E637B417 for ; Wed, 19 Dec 2001 12:46:25 -0800 (PST) Received: (from uucp@localhost) by srv1.cosmo-project.de (8.11.6/8.11.6) with UUCP id fBJKkNo36364; Wed, 19 Dec 2001 21:46:23 +0100 (CET) (envelope-from ticso@cicely9.cicely.de) Received: from mail.cicely.de (cicely20.cicely.de [10.1.1.22]) by cicely5.cicely.de (8.12.1/8.12.1) with ESMTP id fBJKkutx076363; Wed, 19 Dec 2001 21:46:56 +0100 (CET)?g (envelope-from ticso@cicely9.cicely.de) Received: from cicely9.cicely.de (cicely9.cicely.de [10.1.7.11]) by mail.cicely.de (8.11.0/8.11.0) with ESMTP id fBJKktW19816; Wed, 19 Dec 2001 21:46:56 +0100 (CET) Received: (from ticso@localhost) by cicely9.cicely.de (8.11.6/8.11.6) id fBJKkkT66587; Wed, 19 Dec 2001 21:46:46 +0100 (CET) (envelope-from ticso) Date: Wed, 19 Dec 2001 21:46:46 +0100 From: Bernd Walter To: Maxime Henrion Cc: freebsd-hackers@freebsd.org Subject: Re: init code in dynamic libraries Message-ID: <20011219204645.GB66211@cicely9.cicely.de> References: <20011219184930.GA66211@cicely9.cicely.de> <20011219200620.A281@nebula.noos.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011219200620.A281@nebula.noos.fr> User-Agent: Mutt/1.3.24i X-Operating-System: FreeBSD cicely9.cicely.de 5.0-CURRENT alpha Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Dec 19, 2001 at 08:06:20PM +0100, Maxime Henrion wrote: > Bernd Walter wrote: > > How can I add initalisation code to a library without needing to > > call a function in the using application? > > What I saw is that libc does something like this but havn't found > > the starting point of this. > > There are two special functions for that : _init() which will be called > when the object is loaded, and _fini() which will be called when it is > released. I can see that symbol defined in libc.so.5 but no reference in the libc source code. All I see are several *_init functions. Are they all called from within an autocreated _init function? If yes in which order? -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message