https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82501
--- Comment #10 from Andrey Drobyshev <a.drobyshev at samsung dot com> --- Created attachment 45751 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45751&action=edit Work-in-progress fix This patch is pretty raw. It only handles .data, .rodata and .bss. It does not handle reallocation sections and multi-TU case (though the latter apparently needs linker support). I suppose we should introduce a separate flag for this kind of protection (ideas are welcome). Also I have to pass the whole list of varpool nodes one extra time to detect sections which need protection; maybe it could be optimized. Comments?