This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfc] allow -G to take a range


On Tue, May 27, 2003 at 05:14:33PM -0400, DJ Delorie wrote:
> 
> Ok, I'm working on some ideas for optimizing the use of .sdata, for
> cases where it's overflowing in a given application.  Here's the first
> one - allow the user to further limit the types of things that get put
> into .sdata.  This is untested, as I wanted to get some feedback about
> how well received this would be before putting the time into testing.
> 
> The idea here is that gcc will accept either "-G n" or "-G m-n", where
> m is the minimum (defaults to zero for compatibility) and n is the
> maximum.  Thus, one could specify "-G 4-4" to allow *only* 4-byte
> objects in .sdata, under the assumption that 1-byte and 2-byte objects
> are either not speed critical or cause wasted space in .sdata due to
> the alignment filler (fiddling with order and packing is a different
> idea I'm working on).

I don't know if you want to generalize it further to add alignment too.  I
could see that you might not want char aligned items there.  Another thought
(that may be done by now, I haven't looked at the code recently) is to have the
linker put things that don't have the appropriate relocation records against
them don't get put into .sdata/.sbss.

The machine I'm starting to work on shifts its signed offset by the data size,
which means I'm going to want to sort 1 byte aligned items in the middle of the
GP area, then the 2 byte aligned items, then the 4, etc.

In some senses, it would be better to drop this all on the app, and rather than
have the compiler automatically choose, to only put things that the user
specifically requested into the small data area.

-- 
Michael Meissner
email: meissner@the-meissners.org
http://www.the-meissners.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]