This is the mail archive of the 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

> I don't know if you want to generalize it further to add alignment
> too.

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
> .sdata/.sbss.

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
> area.

Yup, something else I'm thinking of, both inclusion and exclusion

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