From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LpQYv-0006z5-O5 for qemu-devel@nongnu.org; Thu, 02 Apr 2009 13:18:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LpQYr-0006v2-4N for qemu-devel@nongnu.org; Thu, 02 Apr 2009 13:18:44 -0400 Received: from [199.232.76.173] (port=44764 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LpQYq-0006us-HH for qemu-devel@nongnu.org; Thu, 02 Apr 2009 13:18:40 -0400 Received: from mail-fx0-f169.google.com ([209.85.220.169]:36291) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LpQYq-0002CO-3O for qemu-devel@nongnu.org; Thu, 02 Apr 2009 13:18:40 -0400 Received: by fxm17 with SMTP id 17so567867fxm.34 for ; Thu, 02 Apr 2009 10:18:39 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 2 Apr 2009 20:18:38 +0300 Message-ID: Subject: Re: [Qemu-devel] [6967] Temporary workaround for ppc on ppc From: Blue Swirl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 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 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?