lkml.org 
[lkml]   [2001]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: const __init
On Mon, May 21, 2001 at 12:19:49AM +0200, Ingo Oeser wrote:
> AFAIK "const" is only a promise to the compiler, that we write
> this data ONCE and read only after this initial write. So the
> decision on the section is implementation defined.

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.


r~
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:53    [W:0.093 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site