public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-60830-4-VgmGOlwUqP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60830-4@http.gcc.gnu.org/bugzilla/>

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)


  parent reply	other threads:[~2014-04-21 14:02 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-13 10:28 [Bug bootstrap/60830] New: " gcc@Denis-Excoffier.org
2014-04-13 11:05 ` [Bug bootstrap/60830] " gcc@Denis-Excoffier.org
2014-04-13 12:33 ` mikpelinux at gmail dot com
2014-04-14  8:44 ` [Bug bootstrap/60830] [4.9 Regression] " rguenth at gcc dot gnu.org
2014-04-14  8:45 ` rguenth at gcc dot gnu.org
2014-04-14  9:05 ` gcc@Denis-Excoffier.org
2014-04-14  9:06 ` gcc@Denis-Excoffier.org
2014-04-14  9:11 ` gcc@Denis-Excoffier.org
2014-04-14 14:16 ` jakub at gcc dot gnu.org
2014-04-14 14:42 ` gcc@Denis-Excoffier.org
2014-04-14 14:43 ` gcc@Denis-Excoffier.org
2014-04-14 17:06 ` ktietz at gcc dot gnu.org
2014-04-14 18:54 ` ktietz at gcc dot gnu.org
2014-04-15  9:35 ` gcc@Denis-Excoffier.org
2014-04-15  9:35 ` gcc@Denis-Excoffier.org
2014-04-15  9:59 ` ktietz at gcc dot gnu.org
2014-04-15 10:04 ` rguenth at gcc dot gnu.org
2014-04-15 10:31 ` ktietz at gcc dot gnu.org
2014-04-15 12:19 ` ktietz at gcc dot gnu.org
2014-04-15 16:20 ` gcc@Denis-Excoffier.org
2014-04-15 16:31 ` gcc@Denis-Excoffier.org
2014-04-15 16:50 ` gcc@Denis-Excoffier.org
2014-04-16  7:38 ` gcc@Denis-Excoffier.org
2014-04-16 12:10 ` ktietz at gcc dot gnu.org
2014-04-18 12:37 ` gcc@Denis-Excoffier.org
2014-04-18 19:37 ` bernd.edlinger at hotmail dot de
2014-04-20 19:09 ` bernd.edlinger at hotmail dot de
2014-04-21 14:02 ` bernd.edlinger at hotmail dot de [this message]
2014-04-21 16:31 ` gcc@Denis-Excoffier.org
2014-04-21 16:35 ` gcc@Denis-Excoffier.org
2014-04-21 16:50 ` bernd.edlinger at hotmail dot de
2014-04-21 17:01 ` gcc@Denis-Excoffier.org
2014-04-21 17:18 ` bernd.edlinger at hotmail dot de
2014-04-21 17:40 ` gcc@Denis-Excoffier.org
2014-04-21 17:52 ` ktietz at gcc dot gnu.org
2014-04-21 20:40 ` bernd.edlinger at hotmail dot de
2014-04-21 20:48 ` bernd.edlinger at hotmail dot de
2014-04-22  7:24 ` ktietz at gcc dot gnu.org
2014-04-22  7:29 ` bernd.edlinger at hotmail dot de
2014-04-22  7:38 ` gcc@Denis-Excoffier.org
2014-04-22 13:50 ` gcc@Denis-Excoffier.org
2014-04-27 14:10 ` mikpelinux at gmail dot com
2014-04-30 14:23 ` ktietz at gcc dot gnu.org
2014-05-02 17:36 ` fanael4 at gmail dot com
2014-05-02 19:50 ` bernd.edlinger at hotmail dot de
2014-07-13 10:34 ` gcc@Denis-Excoffier.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-60830-4-VgmGOlwUqP@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).