https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66219
Bug ID: 66219 Summary: The gcc generated section start/stop pointers become undefined when option -flto is used Product: gcc Version: 4.8.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: dscao999 at hotmail dot com Target Milestone: --- Created attachment 35577 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35577&action=edit This tar contains all the information required for a bug #include <stdio.h> __attribute__ ((__section__("MAP"))) long flags[] = {1, 2, 3, 4, 5, 6}; extern const long __start_MAP[]; extern const long __stop_MAP[]; int main(int argc, char *argv[]) { const long *m; m = __start_MAP; while (m < __stop_MAP) { printf("%d ", *m); m++; } printf("\n"); return 0; } The magic pointers(__start_MAP, __stop_MAP) of sections will become undefined if option -flto is used.