This is the mail archive of the gcc-bugs@gcc.gnu.org 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]
Other format: [Raw text]

[Bug c/70060] array initialization adds to executable size


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...

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