From owner-freebsd-bugs Thu Oct 22 15:07:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA09621 for freebsd-bugs-outgoing; Thu, 22 Oct 1998 15:07:23 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from george.lbl.gov (george.lbl.gov [131.243.2.12]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA09604; Thu, 22 Oct 1998 15:07:19 -0700 (PDT) (envelope-from jin@george.lbl.gov) Received: (from jin@localhost) by george.lbl.gov (8.8.8/8.8.8) id PAA07047; Thu, 22 Oct 1998 15:06:50 -0700 (PDT) Date: Thu, 22 Oct 1998 15:06:50 -0700 (PDT) From: Jin Guojun (FTG staff) Message-Id: <199810222206.PAA07047@george.lbl.gov> To: mike@smith.net.au Subject: Re: ld for loading dynamic library changed in 3.0-RELEASE? Cc: bugs@FreeBSD.ORG, hackers@FreeBSD.ORG Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > 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 : 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. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message