From owner-freebsd-current Mon Nov 4 23:22:13 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F0A8137B401 for ; Mon, 4 Nov 2002 23:22:11 -0800 (PST) Received: from mail.nsu.ru (mx.nsu.ru [193.124.215.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id F127243E3B for ; Mon, 4 Nov 2002 23:22:10 -0800 (PST) (envelope-from fjoe@iclub.nsu.ru) Received: from drweb by mail.nsu.ru with drweb-scanned (Exim 3.20 #1) id 188y2A-0006Q7-00; Tue, 05 Nov 2002 13:21:58 +0600 Received: from iclub.nsu.ru ([193.124.215.97] ident=root) by mail.nsu.ru with esmtp (Exim 3.20 #1) id 188y23-0006Mq-00; Tue, 05 Nov 2002 13:21:51 +0600 Received: from iclub.nsu.ru (fjoe@localhost [127.0.0.1]) by iclub.nsu.ru (8.12.6/8.12.6) with ESMTP id gA57LiFG052977; Tue, 5 Nov 2002 13:21:44 +0600 (NS) (envelope-from fjoe@iclub.nsu.ru) Received: (from fjoe@localhost) by iclub.nsu.ru (8.12.6/8.12.6/Submit) id gA57LhC2052975; Tue, 5 Nov 2002 13:21:43 +0600 (NS) Date: Tue, 5 Nov 2002 13:21:42 +0600 From: Max Khon To: Jake Burkholder Cc: current@FreeBSD.ORG Subject: Re: libc size Message-ID: <20021105132142.A52607@iclub.nsu.ru> References: <3DC17C7F.9020308@acm.org> <20021031140542.W86715-100000@volatile.chemikals.org> <20021031220633.3acd0b53.flynn@energyhq.homeip.net> <3DC1AB26.5020708@acm.org> <20021103155858.3be6eda9.flynn@energyhq.homeip.net> <3DC6CB56.8090809@acm.org> <20021104215734.GA47193@dragon.nuxi.com> <20021105125454.A51180@iclub.nsu.ru> <20021105021823.T22677@locore.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20021105021823.T22677@locore.ca>; from jake@locore.ca on Tue, Nov 05, 2002 at 02:18:23AM -0500 X-Envelope-To: jake@locore.ca, current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG hi, there! On Tue, Nov 05, 2002 at 02:18:23AM -0500, Jake Burkholder wrote: > > > Before someone says you can dlopen() from static binaries in order to > > > implement nsswitch, please provide the patch proving it. Our best > > > FreeBSD minds don't think it can be done properly and sanely. > > > > I have the patch. Currently it is made against RELENG_4 and I have a couple > > of questions about alpha (however it works on alpha too with a few hacks). > > Unfortunately, jdp does not have enough time to review it and I have > > lack of time to port it to -current (that would not be that hard but > > since sparc64 is now Tier-1 platform the patch should be ported to > > sparc64 too but I do not have sparc64 hardware and access to > > panther is very slow from my home). > > > > What is the right place to post the patch and test program > > demonstrating dlopen for statically linked programs? > > Put it up somehere on the web or email it to the list. I'd > be interested in looking at it. Ok, I put the patch and test program to http://people.freebsd.org/~fjoe/libdl.tar.bz2. Patches are made against RELENG_4 (and all tests were done on RELENG_4) but it will not be that hard to port everything to -CURRENT. This is just a proof-of-concept work-in-progress. The plan is to add this stuff (rtld sources with -DLIBDL) to libc.a so statically linked programe will have dlopen/dlsym etc. Problems with current patches are: - I do not know what to do on alpha with _GOT_END_ and _GLOBAL_OFFSET_TABLE_ symbols. I had to use ld.so.script to solve missing _GOT_END_ problem and ifdef out _GLOBAL_OFFSET_TABLE_ usage from alpha/reloc.c for second problem. An advice from alpha rtld guru will be very useful - gdb support for shared objects dlopened from statically linked program is broken - rtld_exit() is not called on exit so fini functions are not called on exit - probably more stuff could be #ifdef'ed out from rtld when it is compiled with -DLIBDL - xmalloc and friends names in rtld sources probably should be prepended with an underscore to prevent name clashes (if this stuff will be included in libc.a) Any comments, suggestions, patches will be very appreciated. /fjoe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message