Date: Wed, 7 Jul 1999 14:50:25 +0100 From: cmatraki AT ee DOT ucl DOT ac DOT uk (Chris Matrakidis) Message-Id: <199907071350.OAA00714@melchard.ee.ucl.ac.uk> To: djgpp-workers AT delorie DOT com Subject: Re: .align directives in libc.a X-Sun-Charset: US-ASCII Reply-To: djgpp-workers AT delorie DOT com > There was a thread some time ago about this, which I think ended up > with a conclusion that the sections are misaligned, and since COFF > aligns relative to the section, we end up with code and some data > which can be aligned or misaligned because of random factors. This > caused programs compiled with GCC 2.8.1 be slower than compiled with > 2.7.2.1. > > The user which investigated this told that he reconfigured Binutils to > produce 32-byte alignment for all sections, and the problem went > away. 32-byte alignment is an overkill, I think, but the problem is > evidently very real. > I counted the number of .bss .data and .text sections in libc.a (nm libc.a | grep .text | wc -l etc.) and ended up with 2123 sections but a lot of them seem to be empty. If we align them to 32 byte boundaries, wasting on average 14 bytes per section, we end up with an aproximately 30K larger libc.a. I think that because of the empty sections the actual increase would be considerably smaller. Even so, this is less than 5%, which I consider quite reasonable. The binutils I have compiled with 32 byte alignment of sections can be found at http://www.ee.ucl.ac.uk/~cmatraki/binutils-291.zip if anyone wants to try them out.