Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LpRGX-0001Ug-3q for qemu-devel@nongnu.org; Thu, 02 Apr 2009 14:03:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LpRGV-0001TH-3q for qemu-devel@nongnu.org; Thu, 02 Apr 2009 14:03:48 -0400 Received: from [199.232.76.173] (port=32863 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LpRGU-0001T8-Tl for qemu-devel@nongnu.org; Thu, 02 Apr 2009 14:03:46 -0400 Received: from fe01x03-cgp.akado.ru ([77.232.31.164]:62286 helo=akado.ru) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LpRGU-0002GX-49 for qemu-devel@nongnu.org; Thu, 02 Apr 2009 14:03:46 -0400 Received: from [10.0.66.9] ([10.0.66.9] verified) by fe01-cgp.akado.ru (CommuniGate Pro SMTP 5.1.16) with ESMTP id 68398520 for qemu-devel@nongnu.org; Thu, 02 Apr 2009 22:03:41 +0400 Date: Thu, 2 Apr 2009 22:03:39 +0400 (MSD) From: malc Subject: Re: [Qemu-devel] [6967] Temporary workaround for ppc on ppc In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Thu, 2 Apr 2009, Blue Swirl wrote: > On 4/2/09, malc wrote: > > Revision: 6967 > > http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6967 > > Author: malc > > Date: 2009-04-02 01:16:39 +0000 (Thu, 02 Apr 2009) > > Log Message: > > ----------- > > Temporary workaround for ppc on ppc > > > > target-ppc/translate.c puts values of type opcode_t into .opcodes > > section, using GCC extension to do so, and hoping that this will make > > them appear contiguously and in the source order in the resulting > > executable. This assumption is not safe and is known to be violated > > with certain versions of GCC, certain flags passed to it and on > > certain platforms (gcc 4.3.0, -O and PPC/PPC64 for instance) > > I've always wondered if the section hack was a very clever one or too > clever one, this makes it clear. > > The section uses could be removed by moving the opcode tables towards There are _no_ opcode tables that's why it fails. The code just does opcode_t in_section(.opcodes) start; ; opcode_t in_section(.opcodes) end; And then scans from &start to &end. The only way, that i know of, to make that work is to indeed put things into a table (an array). > the end of file and making the handler functions use normal C > declarations or aided with a macro. That separates the function and > its table entry a lot, but I guess we don't want to use the #include > trick this time? I think PPC's translate.c should be just split and massaged a lot. -- mailto:av1474@comtv.ru