This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: gas lobotomy, .bss section optimization
- To: "Adam J. Richter" <adam at yggdrasil dot com>
- Subject: Re: gas lobotomy, .bss section optimization
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 1 May 2001 17:24:54 +0200
- Cc: binutils at sourceware dot cygnus dot com
- References: <200105011427.HAA01641@adam.yggdrasil.com>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Tue, May 01, 2001 at 07:27:57AM -0700, Adam J. Richter wrote:
> I have written a small BFD program to move variables that
> have been initialized with all zeroes from .data to .bss. This does
> not shrink a program's RAM image, but it shrinks the program's object
> files and the resultant binary a bit, and it should make the program
> load a microsecond faster. It may even allow people to cram a few
> more bytes onto Linux boot floppies, and it may be helpful for low
> end embedded applications too.
...
IMHO binutils are the wrong place to do this, it is too late in the game.
If you're trying to move some data from one section to another, how do you
assure that all objects get the alignment they wanted? How can you be sure
that something is not part of a larger object?
This should be done in gcc, enabled by some option (which would not be the
default). In gcc this would be fairly trivial to do.
If you look at the SHF_MERGE thread on gcc lists, you'll see Zack looking
exactly for such feature.
Jakub