From owner-freebsd-hackers Thu Oct 22 15:37:02 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA13653 for freebsd-hackers-outgoing; Thu, 22 Oct 1998 15:37:02 -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 PAA13643; Thu, 22 Oct 1998 15:36:57 -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 PAA01466; Thu, 22 Oct 1998 15:40:39 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Message-Id: <199810222240.PAA01466@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Jin Guojun (FTG staff) cc: jdp@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: ld for loading dynamic library changed in 3.0-RELEASE? In-reply-to: Your message of "Thu, 22 Oct 1998 15:06:50 PDT." <199810222206.PAA07047@george.lbl.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 22 Oct 1998 15:40:38 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I didn't notice you'd copied this to -bugs. It's probably not warranted there. > > > In loading a dynamic library, it loads entire library regardless > > > if objects are used or not. I do not know if this is a bug or intended > > > goal, but it does not make sense to build libraries at this point. > > > > I'm sorry, but you're not making yourself very clear here. Could you > > explain a little more? > > Let's say libtest.so containing three (3) files a.c b.c c.c. > a.c: > a() { printf("a"); } > > b.c: > b() { b_printf("b"); } > > c.c: > c() { c_printf("c"); } > > make them into regular library libtest.a and shared library libtest.so. > > creating test file test.c: > > main() > { > a(); > } > > cc -o test test.c -ltest > > on all platforms, this cc will be successfully compiled and linked, > but FreeBSD 3.0 complains : When you say "on all platforms", which one(s) have you tested? I ask simply because under 3.0 we are using the GNU Binutils, so this would appear to be either optional behaviour, or a bug that we might have introduced. > libtest.so: Undefined symbol '_b_printf' referenced from text segment > libtest.so: Undefined symbol '_c_printf' referenced from text segment > > However, "cc -o test test.c -static -ltest" is happy when no shared library > is used. > > So, it looks like just for linking shared library. This would be one for Mr Binutils. John? -- \\ 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