https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100357
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|noinit attribute does not |noinit attribute does not |work sometimes (small data |work sometimes (small data) |or with -fdata-sections) | Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2021-09-22 --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The sbss issue can most likely be fixed by: diff --git a/gcc/varasm.c b/gcc/varasm.c index 2d261b353bf..1216e76be53 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -7063,7 +7063,7 @@ categorize_decl_for_section (const_tree decl, int reloc) } /* If the target uses small data sections, select it. */ - else if (targetm.in_small_data_p (decl)) + else if (!DECL_NOINIT_P (decl) && targetm.in_small_data_p (decl)) { if (ret == SECCAT_BSS) ret = SECCAT_SBSS; But I have no way to test this patch. Anyways confirmed for small data.