From owner-freebsd-current Tue Mar 10 15:04:25 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA22941 for freebsd-current-outgoing; Tue, 10 Mar 1998 15:04:25 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA22931; Tue, 10 Mar 1998 15:04:22 -0800 (PST) (envelope-from jdp@austin.polstra.com) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.8.8/8.8.8) with ESMTP id PAA21639; Tue, 10 Mar 1998 15:04:08 -0800 (PST) (envelope-from jdp) Message-Id: <199803102304.PAA21639@austin.polstra.com> To: ken@plutotech.com Subject: Re: problems stripping kernels In-Reply-To: <199803102018.NAA16119@panzer.plutotech.com> References: <199803102018.NAA16119@panzer.plutotech.com> Organization: Polstra & Co., Seattle, WA Cc: dyson@FreeBSD.ORG, current@FreeBSD.ORG Date: Tue, 10 Mar 1998 15:04:08 -0800 From: John Polstra Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article <199803102018.NAA16119@panzer.plutotech.com>, Kenneth D. Merry wrote: > I've noticed a problem stripping kernels since John's changes on > Saturday went in. (and it wasn't fixed by version 1.46 of ufs_readwrite.c > yesterday) > > Basically, I config my kernels with -g, and then use strip -d to > strip off the debugging symbols (after saving a copy of the kernel with > debugging symbols, of course). The problem is that kernels I strip on a > machine using a kernel built after Saturday's changes don't boot. They > just hang forever with the little spinning cursor. Kernels stripped on the > same machine running a kernel from before Saturday's changes work just > fine. I can confirm this. > From what I can tell, there are three bytes different between the > two kernels: > > $ ls -la kernel* > -rwxr-xr-x 1 ken wheel 1409956 Mar 10 09:50 kernel* > -rwx------ 1 ken wheel 1409956 Mar 10 09:53 kernel.debug* > $ cmp -l kernel kernel.debug > 17 140 20 > 18 266 133 > 19 67 1 Those are in the a.out header in the field that says how many bytes of symbol table are present. I noticed that in the failing case, the header of the stripped kernel still says it has the same number of bytes of symbols as the header of the unstripped kernel it was made from. In other words, this statement at strip.c:241 isn't taking effect: /* Fill in new symbol table size. */ ep->a_syms = (nsym - symbase) * sizeof(NLIST); Here, ep points to an image of the file that was mmapped at line 189: /* Map the file. */ if ((ep = (EXEC *)mmap(NULL, (size_t)sb.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, (off_t)0)) == (EXEC *)MAP_FAILED) { -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message