From owner-freebsd-current Sun Dec 3 15:22:37 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id PAA03564 for current-outgoing; Sun, 3 Dec 1995 15:22:37 -0800 Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id PAA03548 for ; Sun, 3 Dec 1995 15:22:29 -0800 Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id QAA10540; Sun, 3 Dec 1995 16:19:00 -0700 From: Terry Lambert Message-Id: <199512032319.QAA10540@phaeton.artisoft.com> Subject: Re: changes in -current..TEST please To: imb@scgt.oz.au (michael butler) Date: Sun, 3 Dec 1995 16:19:00 -0700 (MST) Cc: terry@lambert.org, current@freebsd.org In-Reply-To: <199512032130.IAA12009@asstdc.scgt.oz.au> from "michael butler" at Dec 4, 95 08:30:47 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1403 Sender: owner-current@freebsd.org Precedence: bulk > > How is dummy_cleanup "not referenced"? > > > phaeton: {50} grep dummy_cleanup *.c > > kern_xxx.c:dummy_cleanup() {} > > kern_xxx.c:TEXT_SET(cleanup_set, dummy_cleanup); > > > Looks referenced to me. > > Yes but look at the reference .. from kernel.h .. > > #define MAKE_SET(set, sym, type) \ > static void *const __set_##set##_sym_##sym = \ > (&__set_##set##_sym_##sym, &sym, 0); \ > asm(".stabs \"_" #set "\", " #type ", 0, 0, _" #sym) > #define TEXT_SET(set, sym) MAKE_SET(set, sym, 23) > #define DATA_SET(set, sym) MAKE_SET(set, sym, 25) > #define BSS_SET(set, sym) MAKE_SET(set, sym, 27) > #define ABS_SET(set, sym) MAKE_SET(set, sym, 21) > > [ .. etc .. ] > > .. it's declared "static" which in all my references, means "local to this > file" and then referenced externally (by the linker) and not by any code > that GCC can see. The resultant compiler behaviour is undefined as far as > I'm aware so I don't believe the claim that GCC is broken in this example > (in other ways, yes, but not this). > > Removing "static" tells the compiler to leave it alone as it _might_ be > referenced beyond its limited vision, Sounds like it's out-clevering itself. Consider the problems this introduces with constructors in an "ld -R" situation. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.