This is the mail archive of the
mailing list for the GCC project.
Re: [rfc] allow -G to take a range
- From: DJ Delorie <dj at redhat dot com>
- To: meissner at the-meissners dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 27 May 2003 20:21:52 -0400
- Subject: Re: [rfc] allow -G to take a range
- References: <200305272114.h4RLEXE22101@greed.delorie.com> <20030527233013.GA9916@tiktok.the-meissners.org>
> I don't know if you want to generalize it further to add alignment
Misunderstanding. The next thing I'm looking at is grouping .sdata
items by alignment, so that they can be packed more efficiently. In
other words, instead of char-fill-int-char-fill-int, it would go
It looks like doing this on a per-module basis (i.e. no linker
changes) isn't going to pan out, since gcc emits decls as it
encounters them instead of all at once.
> 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
That would mean that each object would have to be in its own section
in the object, so that the linker can arrange them and/or exclude them
as needed. The grouping idea I had was to create sections like
.sdata.0, .sdata.1, .sdata.2, etc, corresponding to log2 alignment.
What you'd need is more like the linkonce support.
> 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.
Sounds like my grouping idea would help, modulo the .sbss/.sdata thing
(i.e. you could easily put less aligned things near the sdata/sbss
border, but arranging to have them near the 32k mark is harder).
> 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
Yup, something else I'm thinking of, both inclusion and exclusion