Re: const __init

Jamie Lokier
2001-05-21T12:42:15Z

Richard Henderson wrote:
> No, the problem is not with which section, but what flags that
> section should have. If you put only "const" data in a section,
> then the section should have SHF_WRITE clear. Conversely, if
> you put writable data in a section then SHF_WRITE should be set.
>
> Now, one could argue that gcc should scan the entire file to
> see if there are any non-constant data members added to a
> particular section, and set SHF_WRITE if any such exist.
>
> My answer is: you would not like gcc's memory usage under these
> conditions.

No, I'd argue that gcc should offer a `section_flags' attribute to be
used along with the `section' attribute. Then we change the definition
of __init.

-- Jamie.