Adding the "used" attribute to locally-scoped static variables has no effect, and they are not emitted into the output .s file.
I am using this in combination with the "section" attribute so I can collect the data together; it doesn't matter to me that there's no useful mapping between the C name and the assembler name. -- Summary: gcc "used" attribute has no effect on local-scope static variables Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jeremy at goop dot org GCC build triplet: i386-redhat-linux GCC host triplet: i386-redhat-linux GCC target triplet: i386-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29299