From owner-cvs-all Mon Sep 4 6: 1:31 2000 Delivered-To: cvs-all@freebsd.org Received: from gidora.zeta.org.au (gidora.zeta.org.au [203.26.10.25]) by hub.freebsd.org (Postfix) with SMTP id 95F9A37B422 for ; Mon, 4 Sep 2000 06:01:26 -0700 (PDT) Received: (qmail 339 invoked from network); 4 Sep 2000 13:01:22 -0000 Received: from unknown (HELO bde.zeta.org.au) (203.2.228.102) by gidora.zeta.org.au with SMTP; 4 Sep 2000 13:01:22 -0000 Date: Tue, 5 Sep 2000 00:01:19 +1100 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Dag-Erling Smorgrav Cc: Peter Wemm , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sbin/savecore savecore.c In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 3 Sep 2000, Dag-Erling Smorgrav wrote: > Peter Wemm writes: > > Log: > > I'm not sure what changed to cause this, but using 'dirname' as a variable Someone added namespace pollution (dirname and basename) to libc. > > was colliding with dirname() in libc.a and causing a Sig 10/bus error. > > Just change dirname to savedir and be done with it. > Umm, sounds like linker bogosity to me. It could probably have been > solved by making dirname (and various other global variables) static. The collision is detected for static linkage, but not for dynamic linkage: $ echo 'char *dirname; main() { dirname = "core"; }' >z.c $ cc -o z z.c $ ./z $ cc -static -o z z.c /usr/libexec/elf/ld: Warning: size of symbol `dirname' changed from 4 to 206 in dirname.o /usr/libexec/elf/ld: Warning: type of symbol `dirname' changed from 1 to 2 in dirname.o $ ./z Bus error (core dumped) savecore is statically linked, so the error should have been noticed at makeworld time. I think the linker should know that the symols are in different sections, not just that they have different sizes. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message