https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82411
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Actually it is just undefined what happens when a write to a const variable. So a trap or the write happened for a const both are valid thing. Now const really should be put in the read only section if possible. Putting it in the sdata section is valid thing to do but I doubt some people want it there. Powerpc should have an option which disabled this optimization for const variables. Right now there is a way to disable all of sdata by -G0 option which is a good workaround.