https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84184
--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- I'd suggest fixing the code instead: extern struct s glo_s_middle_hidden[] __attribute__((visibility("hidden"))); which makes it valid C and generates correct code.