From owner-freebsd-hackers Thu Apr 3 10:16:45 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id KAA06593 for hackers-outgoing; Thu, 3 Apr 1997 10:16:45 -0800 (PST) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id KAA06586 for ; Thu, 3 Apr 1997 10:16:39 -0800 (PST) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.8.5/8.8.5) with ESMTP id KAA17009; Thu, 3 Apr 1997 10:14:32 -0800 (PST) Message-Id: <199704031814.KAA17009@austin.polstra.com> To: nnd@info.itfs.nsk.su Subject: Re: FreeBSD Elf-Kit and dynamic loading Newsgroups: polstra.freebsd.hackers In-Reply-To: <5i0j1d$jtk@news.itfs.nsk.su> References: <5i0j1d$jtk@news.itfs.nsk.su> Organization: Polstra & Co., Seattle, WA Cc: hackers@freebsd.org Date: Thu, 03 Apr 1997 10:14:32 -0800 From: John Polstra Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In article <5i0j1d$jtk@news.itfs.nsk.su>, Nickolay N. Dudorov wrote: > Today I try to install ELF-Kit on my 2.2-RELEASE > system. I can succesfully (?) build binutils-2.7, gcc-2.7.2.1, > almost all libraries from /usr/src/lib and libg++-2.7.2. > > After that I can test elf-cc and elf-g++ on > provided in kit hello.c and hello.cc - AND they works. > > And after that I discovered that 'file hello' > says: > hello: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD) ElfKit _should_ be producing dynamically linked executables. Hmm ... Except on FreeBSD-current, the "file" command does not report whether an ELF file is dynamically linked or not. For example, on a dynamically-linked ELF file "hello", the -2.2 "file" command says: hello: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD) The same command on a -current system says: hello: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, not stripped (on a single line). At first, I thought you had a dynamically linked program but did not realize it. But ... > and file 'hello' is 47761 bytes long. > > So, there is a question - is there any possibility to > build "dynamic ELF" program ? My elf-gcc produce identical results > with and without '-static' flag. 47761 bytes is much too large (my "hello" is only 4121 bytes even before stripping it). So I think you really are getting a statically linked executable, for some reason. Are you sure your ELF shared libc is installed properly? You should have this in /usr/local/elf/i386-unknown-freebsdelf/lib: lrwxr-xr-x 1 root bin 9 Apr 16 1996 libc.so -> libc.so.3 -rwxr-xr-x 1 root bin 404921 Apr 15 1996 libc.so.3 If that looks OK, then please run the following command, and send me the output it produces: elf-cc -v -o hello hello.c Thanks, John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth