Date: Tue, 17 Dec 2002 07:30:19 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: "David O'Brien" <obrien@FreeBSD.org> Cc: Peter Wemm <peter@wemm.org>, Poul-Henning Kamp <phk@FreeBSD.org>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org> Subject: Re: cvs commit: src/sys/boot/i386/boot2 Makefile boot1.s Message-ID: <20021217071156.H17797-100000@gamplex.bde.org> In-Reply-To: <20021216180146.GB80874@dragon.nuxi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021217071156.H17797-100000>