http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47278
Summary: [4.3/4.4/4.5 Regression] hidden weak function not handled properly Product: gcc Version: 4.5.2 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: rgue...@gcc.gnu.org > cat t1.c int foo (void) { return 1; } > cat t2.c extern void abort (void); int __attribute__((weak,visibility("hidden"))) foo (void) { return 0; } int main() { if (foo() != 1) abort (); return 0; } This worked fine with GCC 4.1 and does work fine with GCC 4.6. I have a patch for 4.3 for the moment.