This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Increased binary size in RedHat 7 using gcc
- To: "'H . J . Lu'" <hjl at valinux dot com>, Pawan Singh <psingh at turnstone dot com>
- Subject: RE: Increased binary size in RedHat 7 using gcc
- From: Pawan Singh <psingh at turnstone dot com>
- Date: Wed, 14 Feb 2001 10:48:16 -0800
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
We are using -Os and that produces a difference of 100 bytes in text for
"HelloWorld" program and 1K to 20K in all other programs we have.
What is interesting is that using the same "compiler" and same "libraries"
on two different systems RedHat 6.0 and RedHat 7.0, the file sizes are
different.
-Pawan
-----Original Message-----
From: H . J . Lu [mailto:hjl@valinux.com]
Sent: Wednesday, February 14, 2001 10:16 AM
To: Pawan Singh
Cc: 'gcc@gcc.gnu.org'
Subject: Re: Increased binary size in RedHat 7 using gcc
On Wed, Feb 14, 2001 at 09:59:07AM -0800, Pawan Singh wrote:
> We are recently trying to move from RedHat 6.0 to RedHat 7.0. We are using
> the following compiler:
>
> gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
>
> What we are finding is that almost every executable file is bigger on
RedHat
> 7.0 than on RedHat 6.0 using the exact same gcc compiler for exact same
code
> using the same Makefile. It is causing us a lot of problem because this is
> for an embedded use and we cannot afford the code size increase. On
looking
> at the output of "size" on the executable, I can see that the "text"
segment
> has increased in size. It is as if the compiler is generating more
> instructions for the same code.
>
I used -Os. It seems to make a big difference in size.
--
H.J. Lu (hjl@valinux.com)