This is the mail archive of the
mailing list for the GCC project.
Re: Followup: [g++] RFH: Is there a way to make gcc place global const class objects in .rodata ?
- From: "Seongbae Park" <seongbae dot park at gmail dot com>
- To: "Haase Bjoern (PT-BEU/EMT)" <Bjoern dot Haase at de dot bosch dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 9 Aug 2006 08:58:43 -0700
- Subject: Re: Followup: [g++] RFH: Is there a way to make gcc place global const class objects in .rodata ?
- References: <D3C486BA1A1825409E44B17E8FA629600824DFEC@si-mail06.de.bosch.com>
On 8/9/06, Haase Bjoern (PT-BEU/EMT) <Bjoern.Haase@de.bosch.com> wrote:
I realized just a bit too late that there is an open bug report for the
> Bjoern Haase wrote
>Is there a way to place global const objects in .rodata, thus avoiding
construction at program start?
So: Sorry for the noise on the list.
According to PR4131, there is currently no solution for this issue. The
".rodata" placement would be highly desireable for my current projects.
This means that I would be willing to try to implement the required
Since so far I know only about how the back-ends work, I'd appreciate a
hint on where to start, which part of the code to look at, etc. .
Of course, it's best if this can be implemented in the compiler,
but if the size and the number of the readonly data is manageable,
you can do this by hand -
inspect what the layout of the class is by writing a test program
and looking at how the fields are layed out,
and replicating the same data in the assembly.
#pragma ident "Seongbae Park, compiler, http://seongbae.blogspot.com"