From owner-freebsd-hackers Thu Oct 22 16:38:43 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA23035 for freebsd-hackers-outgoing; Thu, 22 Oct 1998 16:38:43 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from dingo.cdrom.com (dingo.cdrom.com [204.216.28.145]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA22993; Thu, 22 Oct 1998 16:38:27 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.cdrom.com [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id QAA01927; Thu, 22 Oct 1998 16:41:33 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Message-Id: <199810222341.QAA01927@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Jin Guojun (FTG staff) cc: mike@smith.net.au, hackers@FreeBSD.ORG, jdp@FreeBSD.ORG Subject: Re: ld for loading dynamic library changed in 3.0-RELEASE? In-reply-to: Your message of "Thu, 22 Oct 1998 16:30:10 PDT." <199810222330.QAA08606@george.lbl.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 22 Oct 1998 16:41:33 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > The testing library is ccs which is out there for many years. > > > It has been used for SGI, DEC, SunOS4, Solaris, Solaris x86, > > > FreeBSD 1.x - 2.x, BSD/OS 2.x - 4.0, Linux 2.0.x - 2.1.x. > > > > > > This is the first time failed to link programs under FreeBSD 3.0, > > > so I created simple files a.c b.c c.c for testing. > > > I thought this may be related to -aout options; but after -static > > > flag is suceeded, I believe the problem is directly related to "ld". > > > It is not related to ar or tsort because a b c are very simple files > > > and -static flag for ld will resolve the symbol issue. > > > > Er, hang on a moment. Are you linking with -aout? You didn't show this > > in your examples. If you use -aout, you're using the old linker, which > > is (AFAIK) exactly the same as it was in 2.2. > > No, I did NOT use "-aout". If I use -aout, I got this: > > ar cr libtest.a `lorder a.o b.o c.o | tsort`; > /usr/libexec/elf/nm: a.o: File format not recognized > /usr/libexec/elf/nm: b.o: File format not recognized > /usr/libexec/elf/nm: c.o: File format not recognized > mv libtest.a /usr/local/lib > ranlib /usr/local/lib/libtest.a > > The errors are from lorder, but library was built, and cc worked. Ok, you should set OBJFORMAT=aout in the environment to get the "right" behaviour. It would be useful to know if this works. > Also, I just found another problem for elf/ld that does not use ENV > variable LD_LIBRARY_PATH. If -Lsomething is not specified, the elf/ld > just look at /usr/lib, regardless what LD_LIBRARY_PATH set to. Unless I'm mistake, LD_LIBRARY_PATH is a runtime, not linktime parameter. Again, we're using the standard binutils linker, so behaviour here should be "standard". -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message