https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116887
--- Comment #20 from chenglulu <chenglulu at loongson dot cn> --- (In reply to Florian Weimer from comment #18) > (In reply to chenglulu from comment #17) > > I don't think it can be completely avoided. But I don't understand why the > > public code does not set the SECTION_RELRO flag when putting decl into > > ".data.rel.ro" via __attribute__. > > I'm not aware of a way to set the RELRO flag directly. We want to write to > these variables during initialization, so we cannot make them const. I > assume we could move the definition into a separate TU and only have the > section attribute on a definition. This would then rely on more relaxed > section merging in the linker. The particular instance that triggered this > bug report would be fairly straightforward to fix, but doing this for e.g. > _rtld_global_ro is more difficult. Um, sorry. I don't quite understand the difference between _rtld_global_ro and __dlfo_main in this regard.