From owner-freebsd-emulation Thu Sep 19 07:08:22 1996 Return-Path: owner-emulation Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA23353 for emulation-outgoing; Thu, 19 Sep 1996 07:08:22 -0700 (PDT) Received: from mail1.infinet.com (mail1.infinet.com [206.103.240.3]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA23333 for ; Thu, 19 Sep 1996 07:08:19 -0700 (PDT) Received: from drobina.my.domain (cmh-p087.infinet.com [206.103.242.91]) by mail1.infinet.com (8.7.3/8.7.3) with SMTP id KAA11545 for ; Thu, 19 Sep 1996 10:08:08 -0400 (EDT) Date: Thu, 19 Sep 1996 10:07:25 -0400 (EDT) From: James Drobina X-Sender: jdrobina@drobina.my.domain To: freebsd-emulation@freebsd.org Subject: Linker from Slackware always produces staticly linked programs Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Transfer-Encoding: QUOTED-PRINTABLE Sender: owner-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I installed gcc, ld, the libraris, etc from Linux Slackware 96 into=20 /compat/linux. I built hello world. When I tried to run it, it core=20 dumped. I am running FreeBSD 2.2-CURRENT built Thu Sep 19 07:50:53. I've narrowed the problem down to program being statically rather than=20 dynamically linked. I could not force linker to dynamically link the=20 program. The linker distribued with SLackware 96 is $ ld -v ld version cygnus-2.6 (with BFD 2.6.0.14) If I replace the Slackare 96 linker with an older version. I can link=20 dynamic programs and hello world works. I backed the linker out and=20 replaced it with $ ./ld -v ld version cygnus/linux-2.5.2l.17 (with BFD cygnus/linux-2.5.2l.11) Has anyone seen this problem? Is it a slackware problem or an emulation problem? $ gcc -v -Ddynamic -o hello hello.o Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.2/specs gcc version 2.7.2 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.1 -o hello /usr/lib/crt1.o= /usr/lib/crti.o /usr/lib/crtbegin.o=20 -L/usr/lib/gcc-lib/i486-linux/2.7.2 hello.o -lgcc -lc -lgcc /usr/lib/crtend= .o /usr/lib/crtn.o $ ./hello Memory fault (core dumped)=20 $ ldd hello statically linked (ELF) Also, each time hello is ran, it creates an odd-named file in the current= =20 directory. The same file is added each time the program is ran, although= =20 the file may have differnt modes. $ ls hello hello.core ?=D6=BF=EF ?=D6=BF=EF hello.c hello.o ?=D6=BF=EF $ ls -l total 504 -rwxrwxr-x 1 jdrobina jdrobina 88534 Sep 19 09:31 hello -rw-rw-r-- 3 jdrobina jdrobina 59 Sep 18 21:19 hello.c -rw------- 1 jdrobina jdrobina 147456 Sep 19 09:31 hello.core -rw-rw-r-- 1 jdrobina jdrobina 3648 Sep 19 08:16 hello.o dr-x-wx--- 2 jdrobina jdrobina 512 Sep 19 09:31 ?=D6=BF=EF dr-x-wxr-- 2 jdrobina jdrobina 512 Sep 19 09:04 ?=D6=BF=EF dr-xr----- 2 jdrobina jdrobina 512 Sep 19 08:26 ?=D6=BF=EF $ od -cx < . 0000000 / D 001 \0 \f \0 004 001 . \0 \0 \0 u B 001 \0 442f 0001 000c 0104 002e 0000 4275 0001 0000020 \f \0 004 002 . . \0 \0 . D 001 \0 020 \0 \b 007 000c 0204 2e2e 0000 442e 0001 0010 0708 0000040 h e l l o . o \0 e C 001 \0 020 \0 \b 007 6568 6c6c 2e6f 006f 4365 0001 0010 0708 0000060 h e l l o . c \0 O D 001 \0 020 \0 \b 005 6568 6c6c 2e6f 0063 444f 0001 0010 0508 0000100 h e l l o \0 =BE =F1 033 032 001 \0 020 \0 004 00= 4 6568 6c6c 006f f1be 1a1b 0001 0010 0404 0000120 234 =D6 =BF =EF \0 \0 \0 \0 P D 001 \0 024 \0 \b = \n d69c efbf 0000 0000 4450 0001 0014 0a08 0000140 h e l l o . c o r e \0 =F3 002 k 001 \0 6568 6c6c 2e6f 6f63 6572 f300 6b02 0001 0000160 020 \0 004 004 230 =D6 =BF =EF \0 \0 \0 \0 =C9 203 00= 1 \0 0010 0404 d698 efbf 0000 0000 83c9 0001 0000200 204 001 004 004 224 =D6 =BF =EF \0 \0 \0 \0 \0 \0 \0 = \0 0184 0404 d694 efbf 0000 0000 0000 0000 0000220 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 0000 0000 0000 0000 0000 0000 0000 0000 * 0001000