From owner-cvs-all Mon Dec 16 12:29:38 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3DFAB37B401; Mon, 16 Dec 2002 12:29:37 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79D9B43EC5; Mon, 16 Dec 2002 12:29:35 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id HAA06355; Tue, 17 Dec 2002 07:29:22 +1100 Date: Tue, 17 Dec 2002 07:30:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: "David O'Brien" Cc: Peter Wemm , Poul-Henning Kamp , , Subject: Re: cvs commit: src/sys/boot/i386/boot2 Makefile boot1.s In-Reply-To: <20021216180146.GB80874@dragon.nuxi.com> Message-ID: <20021217071156.H17797-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 16 Dec 2002, David O'Brien wrote: > On Sun, Dec 15, 2002 at 08:31:45PM +1100, Bruce Evans wrote: > > Please remove the alignment hacks (Makefile rev.1.25) while you are there. > > Breakage of -[fm]align-* seems to have been fixed in gcc, so the hacks > > make no difference except to reduce the size of boot2.o's data by 3 bytes > > (I think the 3 bytes is wasted at link time). > > I'd rather leave them in to get the 3 bytes -- believe it or not it has > made a difference in the past. It doesn't any difference because the 3 bytes is wasted at link time. The data section has size 29, but sections are padded to 4-byte boundaries, at least for ELF objects with the default linker scripts, so 29 becomes 32 the same as if it had been padded internally for aligment. If the 3 bytes once made a difference then it was because it pushed the size of boot2.o across a 4-byte boundary. If saving 3 bytes actually matters then it should be programmed using a hand-packed struct containing all (initialized) data. There may be more wastage in the read-only section. Short strings are always aligned, so the alignment hack makes no difference for them. Long stings are not forcibly aligned using -mno-align-long strings, but there aren't any now. There may be external wastage for the read-only section. aout objects were padded to 16-byte boundaries, so aout versions of the boot blocks had to be more careful about wastage. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message