Date: Sun, 3 Dec 1995 16:19:00 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: imb@scgt.oz.au (michael butler) Cc: terry@lambert.org, current@freebsd.org Subject: Re: changes in -current..TEST please Message-ID: <199512032319.QAA10540@phaeton.artisoft.com> In-Reply-To: <199512032130.IAA12009@asstdc.scgt.oz.au> from "michael butler" at Dec 4, 95 08:30:47 am
next in thread | previous in thread | raw e-mail | index | archive | help
> > 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512032319.QAA10540>