https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97803
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Does it work if you add -fno-toplevel-reorder? SHF_GNU_RETAIN should preserve the order of vars even if 'used' then.
rguenth at gcc dot gnu.org via Gcc-bugs Wed, 11 Nov 2020 23:15:24 -0800
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97803
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Does it work if you add -fno-toplevel-reorder? SHF_GNU_RETAIN should preserve the order of vars even if 'used' then.