From owner-freebsd-current Tue Mar 10 15:44:13 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA01381 for freebsd-current-outgoing; Tue, 10 Mar 1998 15:44:13 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from pat.idi.ntnu.no (0@pat.idi.ntnu.no [129.241.103.5]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA01268; Tue, 10 Mar 1998 15:43:58 -0800 (PST) (envelope-from Tor.Egge@idi.ntnu.no) Received: from idi.ntnu.no (tegge@presis.idi.ntnu.no [129.241.111.173]) by pat.idi.ntnu.no (8.8.8/8.8.8) with ESMTP id AAA09003; Wed, 11 Mar 1998 00:43:25 +0100 (MET) Message-Id: <199803102343.AAA09003@pat.idi.ntnu.no> To: ken@plutotech.com Cc: current@FreeBSD.ORG, dyson@FreeBSD.ORG Subject: Re: problems stripping kernels In-Reply-To: Your message of "Tue, 10 Mar 1998 11:01:23 -0700 (MST)" References: <199803101801.LAA15498@panzer.plutotech.com> X-Mailer: Mew version 1.70 on Emacs 19.34.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 11 Mar 1998 00:43:25 +0100 From: Tor Egge Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Howdy, > > 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) > The following patch worked for me as a workaround. As long as msync()/munmap() is performed before ftruncate(), there is no problems with regard to what is 'legal' values for the size fields. Index: strip.c =================================================================== RCS file: /home/ncvs/src/usr.bin/strip/strip.c,v retrieving revision 1.11 diff -u -r1.11 strip.c --- strip.c 1997/08/12 06:44:57 1.11 +++ strip.c 1998/03/09 22:35:26 @@ -250,12 +250,13 @@ */ bcopy(nstrbase, (void *)nsym, len); + msync((caddr_t) ep, (size_t)sb.st_size, MS_SYNC); + munmap((caddr_t)ep, (size_t)sb.st_size); /* Truncate to the current length. */ if (ftruncate(fd, (char *)nsym + len - (char *)ep)) { warn("%s", fn); err_val = 1; } - munmap((caddr_t)ep, (size_t)sb.st_size); } static void - Tor Egge To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message