From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7000 invoked by alias); 21 Apr 2014 14:02:50 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 6945 invoked by uid 48); 21 Apr 2014 14:02:47 -0000 From: "bernd.edlinger at hotmail dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/60830] [4.9 Regression] ICE on bootstrapping on cygwin Date: Mon, 21 Apr 2014 14:02:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: bernd.edlinger at hotmail dot de X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg01430.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60830 --- Comment #30 from Bernd Edlinger --- 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 extern void test() __attribute__((weak)); int main() { printf("hello\n"); test(); return 0; } __attribute__((weak)) void test() { printf("weak\n"); } $ cat test1.c #include void test() { printf("strong\n"); } $ gcc -o test test.c test1.c $ ./test hello Segmentation fault (core dumped)