const char __attribute__((__section__(".bss.page_aligned.const"), __aligned__(4096))) zero_page[4096]; is rejected starting with r251602. I think if the user explicitly requests it to be put into a bss section, we should do it even when it is read-only.
Created attachment 43348 [details] gcc8-pr84237.patch Untested fix.
Author: jakub Date: Fri Feb 9 05:47:24 2018 New Revision: 257513 URL: https://gcc.gnu.org/viewcvs?rev=257513&root=gcc&view=rev Log: PR middle-end/84237 * output.h (bss_initializer_p): Add NAMED argument, defaulted to false. * varasm.c (bss_initializer_p): Add NAMED argument, if true, ignore TREE_READONLY bit. (get_variable_section): For decls in named .bss* sections pass true as second argument to bss_initializer_p. * gcc.dg/pr84237.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr84237.c Modified: trunk/gcc/ChangeLog trunk/gcc/output.h trunk/gcc/testsuite/ChangeLog trunk/gcc/varasm.c
Fixed.