From owner-freebsd-hackers Tue Nov 28 08:48:57 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id IAA18075 for hackers-outgoing; Tue, 28 Nov 1995 08:48:57 -0800 Received: from expo.x.org (expo.x.org [198.112.45.11]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id IAA18070 for ; Tue, 28 Nov 1995 08:48:53 -0800 Received: from exalt.x.org by expo.x.org id AA13035; Tue, 28 Nov 95 11:48:21 -0500 Received: from localhost by exalt.x.org id QAA15023; Tue, 28 Nov 1995 16:48:20 GMT Message-Id: <199511281648.QAA15023@exalt.x.org> To: Bruce Evans Cc: hackers@freefall.FreeBSD.org Subject: Re: gcc 2.1.7 (and libg++) In-Reply-To: Your message of Wed, 29 Nov 1995 02:28:15 EDT. <199511281528.CAA02383@godzilla.zeta.org.au> Organization: X Consortium Date: Tue, 28 Nov 1995 11:48:19 EDT From: "Kaleb S. KEITHLEY" Sender: owner-hackers@FreeBSD.ORG Precedence: bulk > > Bruce> I just deleted ASM_WEAKEN_LABEL() for 2.7.0. This may have > > Bruce> broken the C++ feature that depends on weak symbols. > > >My compiler implementation days are long gone ... what the heck is a > >weak symbol? > > It has something to do with allowing user functions to replace library > functions. > It's really for library developers. A programmer has always been able to replace library functions with his or her own functions, which may or may not be a good thing. One use of weak symbols for example, is if you build X on a platform with threads libX11 and libXt will reference thread functions. But a non-threaded program usually doesn't want to link with the thread library for performance (threads in a non-threaded program does add overhead) and other reasons. Stub routines in libc (with #pragma weak) allow the references in libX11 and libXt to be resolved without linking the threads library. But a real threaded program will link with the thread library and the semantics of weak will allow the symbols in the threads library to take precedence over the weak symbols in libc. (It took Sun a couple revs of Solaris to get this right, and Unixware 2.x didn't learn from Sun's mistakes.) -- Kaleb KEITHLEY