From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23749 invoked by alias); 28 Jan 2013 17:36:13 -0000 Received: (qmail 23610 invoked by uid 22791); 28 Jan 2013 17:36:11 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from dns1.mips.com (HELO dns1.mips.com) (12.201.5.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Jan 2013 17:36:05 +0000 Received: from mailgate1.mips.com (mailgate1.mips.com [12.201.5.111]) by dns1.mips.com (8.13.8/8.13.8) with ESMTP id r0SHa2fn018895; Mon, 28 Jan 2013 09:36:02 -0800 X-M-MSG: Received: from exchdb01.mips.com (unknown [192.168.36.84]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mailgate1.mips.com (Postfix) with ESMTP id 22D0936464F; Mon, 28 Jan 2013 09:35:58 -0800 (PST) Received: from [192.168.65.53] (192.168.65.53) by exchhub01.mips.com (192.168.36.84) with Microsoft SMTP Server id 14.2.247.3; Mon, 28 Jan 2013 09:35:56 -0800 Subject: RE: [PATCH 2/2] MIPS16: MIPS16 support proper From: Steve Ellcey To: "Maciej W. Rozycki" CC: "libc-alpha@sourceware.org" , "libc-ports@sourceware.org" , Chung-Lin Tang In-Reply-To: References: <1359151771.11963.200.camel@ubuntu-sellcey> Content-Type: text/plain; charset="us-ascii" Date: Mon, 28 Jan 2013 17:36:00 -0000 Message-ID: <1359394555.32571.12.camel@ubuntu-sellcey> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-EMS-Proccessed: 6LP3oGfGVdcdb8o1aBnt6w== X-EMS-STAMP: NlmQIirPO5sLBWR1SMlbYg== Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2013-01/txt/msg00065.txt.bz2 On Sat, 2013-01-26 at 00:31 +0000, Maciej W. Rozycki wrote: > On Fri, 25 Jan 2013, Steve Ellcey wrote: > > > > Please also note that as I mentioned along the patch submission mixing > > > execution modes in static constructors or destructors installed as single > > > lumps of code (that is with the use of the DT_INIT or DT_FINI dynamic > > > tags) cannot be supported. Can you run `objdump -j .init -j .fini -d' on > > > your binary and make sure the disassembly looks right? > > > > Mine looks a bit different, this is the .init and .fini from a > > dynamically linked big endian hello world program, I am not sure where > > the addiu instructions are coming from. > > You have some standard MIPS code there, this is not ever going to work > unless we switch to DT_INIT_ARRAY and DT_FINI_ARRAY > constructors/destructors. Until then you need to rebuild the relevant > sources as MIPS16 code. OK, I see where this is happening now. crti (from glibc) is mips16 and crtbegin (from gcc) is mips32. crtbegin is mips32 because it uses CRT_CALL_STATIC_FUNCTION and that has '.nomips16' in it. I am not sure how to rewrite CRT_CALL_STATIC_FUNCTION in mips16 to avoid this and it looks like the codesourcery version of GCC is handling this by making all .init/.fini code mips32 instead of mips16. So, should I try to make crti use a mips32 .init or make crtbegin use a mips16 .init? I am not sure which is better. Steve Ellcey sellcey@mips.com