Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Mar 2003 13:44:21 -0800
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Daniel Eischen <eischen@pcnet1.pcnet.com>
Cc:        Warner Losh <imp@harmony.village.org>
Subject:   Re: Not providing static libraries (libkse/libpthread)
Message-ID:  <20030326214421.GF11320@dhcp01.pn.xcllnt.net>
In-Reply-To: <Pine.GSO.4.10.10303261558200.19728-100000@pcnet1.pcnet.com>
References:  <200303262030.h2QKU6A7089578@harmony.village.org> <Pine.GSO.4.10.10303261558200.19728-100000@pcnet1.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 26, 2003 at 04:04:42PM -0500, Daniel Eischen wrote:
> 
> Also, in a lot of functions, there are:
> 
> 	if (_thread_initial == NULL)
> 		_thread_init();
> 
> I'd like to be able to get rid of these eventually and perhaps have
> some magical way of getting it called automatically when the library
> is loaded.

You may be able to piggyback on the C++ static object initialization
by utilizing _init() and _fini(). I don't think archive is different
from shared in that respect for C (ie they both don't have what _init()
provides and have _fini() in terms for atexit()). But it works in both
cases if you add some C++ related magic (See also the .init and .fini
ELF sections).

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030326214421.GF11320>