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]

Re: The bloat sweepstakes...

On 10-Oct-2001, Zack Weinberg <> wrote:
> On Wed, Oct 10, 2001 at 04:24:03PM +1000, Fergus Henderson wrote:
> > Note that the rodata and bss sizes are both problematic for the Mercury
> > front-end.  The reason is that the Mercury front-end uses the Boehm
> > conservative collector, which scans the bss section and
> > (on most systems) the rodata section. [...]
> That seems strange to me: it does scan rodata and it doesn't scan
> text?

It doesn't scan text on any of the supported systems, AFAIK.
But it does scan rodata on most of them, I think.

> On most systems I am familar with, the boundary between
> (text+rodata) and (data+bss) is obvious, but the boundary between text
> and rodata is not.

That's not the case for most of the systems I'm familiar with.

> I very much hope it doesn't scan rodata, because I
> have Cunning Plans to reduce the text size considerably at the expense
> of a somewhat larger rodata.  Note that much of rodata is strings.

What it scans is system-dependent.  It's determined by DATASTART and
DATAEND in gcconfig.h.  On most systems, DATASTART seems to be defined
as &_etext, and on the systems that I'm familiar with, &_etext generally
precedes the rodata section.  (At least that is my understanding. 
I could be wrong about that.  See below.)

However, on x86 Linux, it does look like the Boehm collector has now
been optimized to not scan rodata, by setting DATASTART to &__data_start
rather than &_etext.

Since your expectation obviously differed from mine here, I tested a few
systems, namely i686-pc-linux-gnu (binutils 2.9.1), alpha-dec-osf3.2,
and i386-pc-solaris2.7.  For the first two, &_etext precedes rodata,
but for the last one, it is the other way around.

Fergus Henderson <>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <>  |     -- the last words of T. S. Garp.

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