Compiling the test case, produces undefined symbols codestrs_4 and codestrs_8, which will result in a link error.
If the static is dropped or one of the cases in the switch statement is removed, the object file does not have undefined symbols. Test case: static const union codestrs_t_4 { struct { char str_2[sizeof ("Illegal opcode")]; }; char str[0]; } codestrs_4 = { {"Illegal opcode"} }; static const union codestrs_t_8 { struct { char str_12[sizeof ("Integer divide by zero")]; }; char str[0]; } codestrs_8 = { {"Integer divide by zero"} }; const char * psiginfo (int pinfo) { const char *base = ((void *)0); switch (pinfo) { case 4: base = codestrs_4.str; break; case 8: base = codestrs_8.str; break; } return base; } Compiled with: gcc -O2 -c objdump -t Result: cases.o: file format elf32-powerpc SYMBOL TABLE: 00000000 l df *ABS* 00000000 cases.c 00000000 l d .text 00000000 .text 00000000 l d .data 00000000 .data 00000000 l d .bss 00000000 .bss 00000000 l O .data 00000014 CSWTCH.1 00000000 l d .note.GNU-stack 00000000 .note.GNU-stack 00000000 l d .comment 00000000 .comment 00000000 l d .gnu.attributes 00000000 .gnu.attributes 00000000 g F .text 00000024 psiginfo 00000000 *UND* 00000000 codestrs_4 00000000 *UND* 00000000 codestrs_8 -- Summary: Static variable leaves undefined symbol in object file Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: edmar at freescale dot com GCC build triplet: powerpc-unknown-linux-gnu GCC host triplet: powerpc-unknown-linux-gnu GCC target triplet: powerpc-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39565