http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29963



--- Comment #2 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 
2012-11-01 21:42:12 UTC ---

(In reply to comment #1)

> I'm not sure how the proposed optimization could be done in a generic way.  It

> would not work for code (i.e. text section) that resides in read-only memory,

> such as ROM or MMU read-only pages.



In that case, you could indeed only do this optimization for constant

variables / arrays.



But it is not uncommon to load the program into RAM before executing,

e.g. because the ROM it's stored in is too slow.  In this case, placing

the program code in a writable segment is merely a matter of policy;

the user would be expected have control if this optimization is enabled,

taking into account if there are any overriding security concerns.

Reply via email to