From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27148 invoked by alias); 11 Mar 2009 16:53:02 -0000 Received: (qmail 27136 invoked by uid 22791); 11 Mar 2009 16:53:01 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Mar 2009 16:52:54 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n2BGqlMU007941; Wed, 11 Mar 2009 12:52:47 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n2BGqlKg019486; Wed, 11 Mar 2009 12:52:47 -0400 Received: from zebedee.pink (vpn-12-253.rdu.redhat.com [10.11.12.253]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n2BGqjJV022224; Wed, 11 Mar 2009 12:52:46 -0400 Message-ID: <49B7EC5C.80107@redhat.com> Date: Wed, 11 Mar 2009 16:53:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.17 (X11/20081009) MIME-Version: 1.0 To: Kurt Miller CC: java@gcc.gnu.org Subject: Re: gcj on OpenBSD References: <49B7D280.5020306@intricatesoftware.com> In-Reply-To: <49B7D280.5020306@intricatesoftware.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2009-03/txt/msg00002.txt.bz2 Kurt Miller wrote: > I've been working on getting gcj up and running on OpenBSD/i386. > Currently I'm working on adding gcj to gcc 4.2 port. I'm pretty far > along with the work: enabled dwarf2 exceptions, thread model posix, etc. > The build completes but gcj-dbtool segfaults and gij too. The segfault > occurs when initializing the class loader because engine is null. > > Could anyone suggest some ideas for diagnosing the root cause of this? This happens because class registration hasn't been done. gcc generates a magic section called .jcr, and this is a list of pointers to classes. On x86_64 a .jcr section in an .o file with two classes looks like this: RELOCATION RECORDS FOR [.jcr]: OFFSET TYPE VALUE 0000000000000000 R_X86_64_64 P::class$ 0000000000000008 R_X86_64_64 Hello::class$ And the .init section: 0000000000400bb0 <_init>: 400bb0: 48 83 ec 08 sub $0x8,%rsp 400bb4: e8 63 01 00 00 callq 400d1c 400bb9: e8 f2 01 00 00 callq 400db0 400bbe: e8 2d 04 00 00 callq 400ff0 <__do_global_ctors_aux> 400bc3: 48 83 c4 08 add $0x8,%rsp 400bc7: c3 retq which calls (*_Jv_RegisterClasses) 0000000000400db0 : 400db0: 55 push %rbp 400db1: 48 83 3d 87 04 20 00 cmpq $0x0,0x200487(%rip) # 601240 <__JCR_LIST__> 400db8: 00 400db9: 48 89 e5 mov %rsp,%rbp 400dbc: 74 1a je 400dd8 400dbe: 41 bb 18 0c 40 00 mov $0x400c18 <_Jv_RegisterClasses@plt>,%r11d 400dc4: 4d 85 db test %r11,%r11 400dc7: 74 0f je 400dd8 400dc9: bf 40 12 60 00 mov $0x601240 <__JCR_LIST__>,%edi 400dce: c9 leaveq 400dcf: 41 ff e3 jmpq *%r11 400dd2: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 400dd8: c9 leaveq 400dd9: c3 retq I suspect that this mechanism is not working on BSD. Andrew.