Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Mar 1998 00:43:25 +0100
From:      Tor Egge <Tor.Egge@idi.ntnu.no>
To:        ken@plutotech.com
Cc:        current@FreeBSD.ORG, dyson@FreeBSD.ORG
Subject:   Re: problems stripping kernels
Message-ID:  <199803102343.AAA09003@pat.idi.ntnu.no>
In-Reply-To: Your message of "Tue, 10 Mar 1998 11:01:23 -0700 (MST)"
References:  <199803101801.LAA15498@panzer.plutotech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803102343.AAA09003>