This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/70060] array initialization adds to executable size
- From: "stsp at users dot sourceforge.net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 Mar 2016 16:51:28 +0000
- Subject: [Bug c/70060] array initialization adds to executable size
- Auto-submitted: auto-generated
- References: <bug-70060-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70060
--- Comment #4 from Stas Sergeev <stsp at users dot sourceforge.net> ---
(In reply to Jakub Jelinek from comment #3)
> If you want it to be initialized at runtime, do that yourself.
> The compiler can't do that, you could e.g. access bigarr from another
> compilation unit before the constructors of this CU are executed etc.
OK, but in my example only the first element
of an array needs an initialization. Wasn't it
possible in that case to reserve just 1 page in
rodata and not waste the megabytes of space for all zeros?
But yes, I understand having sparse rodata would
be a difficult task to achieve...