http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60830
--- Comment #30 from Bernd Edlinger <bernd.edlinger at hotmail dot de> --- It looks like a bug in the assembler! with objdump -d -r crtbegin.o we have wrong code: f3: 83 ec 04 sub $0x4,%esp f6: 85 c0 test %eax,%eax f8: ba f0 ff ff ff mov $0xfffffff0,%edx f9: dir32 ___deregister_frame_info fd: 74 16 je 115 <___gcc_deregister_frame+0x35> but the cygming-crtbegin.s looks correct: LVL17: .loc 1 158 0 testl %eax, %eax .loc 1 162 0 movl $___deregister_frame_info, %edx .loc 1 158 0 je L27 whenever there is a weak definition the reference is actually minus the offset of the previous weak definition. Everything is OK if that was at offset zero. test case: $ cat test.c #include <stdio.h> extern void test() __attribute__((weak)); int main() { printf("hello\n"); test(); return 0; } __attribute__((weak)) void test() { printf("weak\n"); } $ cat test1.c #include <stdio.h> void test() { printf("strong\n"); } $ gcc -o test test.c test1.c $ ./test hello Segmentation fault (core dumped)