Date: Mon, 18 Sep 2000 12:10:46 +0700 (NSS) From: Max Khon <fjoe@iclub.nsu.ru> To: John Polstra <jdp@polstra.com> Cc: hackers@freebsd.org Subject: Re: Trouble with dynamic loading of C++ libs in PHP v4.02 on FreeBSD 4.1 Message-ID: <Pine.BSF.4.21.0009181204060.4653-100000@iclub.nsu.ru> In-Reply-To: <200009160037.RAA06418@vashon.polstra.com>
next in thread | previous in thread | raw e-mail | index | archive | help
hi, there!
On Fri, 15 Sep 2000, John Polstra wrote:
> Here is another possibility: we could call _thread_init() from
> crt1.o. The patch (untested) is below. It calls _thread_init() if
> and only if that symbol is defined -- i.e., libc_r is linked in.
> What do you think about this solution?
>
> Index: crt1.c
> ===================================================================
> RCS file: /home/ncvs/src/lib/csu/i386-elf/crt1.c,v
> retrieving revision 1.4
> diff -u -r1.4 crt1.c
> --- crt1.c 1999/08/27 23:57:57 1.4
> +++ crt1.c 2000/09/16 00:30:51
> @@ -48,6 +48,9 @@
> extern int _DYNAMIC;
> #pragma weak _DYNAMIC
>
> +extern void _thread_init(void);
> +#pragma weak _thread_init
> +
> #ifdef __i386__
> #define get_rtld_cleanup() \
> ({ fptr __value; \
> @@ -91,6 +94,8 @@
> #ifdef GCRT
> monstartup(&eprol, &etext);
> #endif
> + if (&_thread_init != NULL)
> + _thread_init();
> _init();
> exit( main(argc, argv, env) );
> }
>
seems ok to me but can we do this from `do_ctors' or `_init' -- they are
located in common/
/fjoe
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0009181204060.4653-100000>
