From owner-freebsd-current Tue Nov 5 12:57: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 8685C37B404 for ; Tue, 5 Nov 2002 12:57:11 -0800 (PST) Received: from mail.nsu.ru (mx.nsu.ru [193.124.215.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB37543E42 for ; Tue, 5 Nov 2002 12:57:09 -0800 (PST) (envelope-from fjoe@iclub.nsu.ru) Received: from drweb by mail.nsu.ru with drweb-scanned (Exim 3.20 #1) id 189Akf-00012s-00; Wed, 06 Nov 2002 02:56:45 +0600 Received: from iclub.nsu.ru ([193.124.215.97] ident=root) by mail.nsu.ru with esmtp (Exim 3.20 #1) id 189AkX-0000xj-00; Wed, 06 Nov 2002 02:56:37 +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 gA5KuMFG078810; Wed, 6 Nov 2002 02:56:22 +0600 (NS) (envelope-from fjoe@iclub.nsu.ru) Received: (from fjoe@localhost) by iclub.nsu.ru (8.12.6/8.12.6/Submit) id gA5KuM1B078809; Wed, 6 Nov 2002 02:56:22 +0600 (NS) Date: Wed, 6 Nov 2002 02:56:21 +0600 From: Max Khon To: Jake Burkholder Cc: current@FreeBSD.ORG Subject: Re: libc size Message-ID: <20021106025621.A78377@iclub.nsu.ru> References: <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> <20021105132142.A52607@iclub.nsu.ru> <20021105120833.V22677@locore.ca> <20021106002050.A72989@iclub.nsu.ru> <20021105152757.Y22677@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: <20021105152757.Y22677@locore.ca>; from jake@locore.ca on Tue, Nov 05, 2002 at 03:27:57PM -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 03:27:57PM -0500, Jake Burkholder wrote: > > Are you talking about STATICOBJS and SHOBJS? This is how libpam is built > > right now. You have different sets object files in shared and static > > versions of libpam. Please take a look at src/lib/libpam/libpam/Makefile > > and corresponding /usr/share/mk bits. > > What I was referring to is a trick to force the linker to generate > a dynamic binary with all the usual elf dynamic tables, but which is > actually statically linked. > > eg: > > > cat test.c > int > main(void) > { > printf("hello world\n"); > } > > cc -static -Wl,-r -o test test.c > > touch hack.c > > cc -shared -o hack.So hack.c > > ld -o test1 test /home/jake/hack.So > > ./test1 > hello world > > > > Conceivably this would allow dlopen to work on the main program, and is > what we do to allow the kernel to link klds against itself. But you > also need to do something about the .interp section that gets put in, > and the .dynamic, .dynsym and .dynstr sections aren't free. Got it. But this will not solve the problem. All the symbols in statically linked executable are resolved at linking stage and there is no information in it that libdl can use in find_symdef() (if we strip the executable. Do we want unstripped executables?). Patching binutils is not easy and I doubt that someone would like to do this. /fjoe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message