From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11851 invoked by alias); 4 Oct 2006 20:52:32 -0000 Received: (qmail 11838 invoked by uid 22791); 4 Oct 2006 20:52:31 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 04 Oct 2006 20:52:23 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GVDj3-0001tE-28; Wed, 04 Oct 2006 16:52:21 -0400 Date: Wed, 04 Oct 2006 20:52:00 -0000 From: Daniel Jacobowitz To: David Edelsohn Cc: Janani Janakiraman , gdb-patches@sourceware.org, pgilliam@us.ibm.com, Alan Modra Subject: Re: [patch] Pushing Inferior Function Arguments onto Stack on PowerPC64 machines Message-ID: <20061004205221.GA7149@nevyn.them.org> Mail-Followup-To: David Edelsohn , Janani Janakiraman , gdb-patches@sourceware.org, pgilliam@us.ibm.com, Alan Modra References: <20061004191056.GA4000@nevyn.them.org> <20061004202638.GA6253@nevyn.them.org> <200610042043.k94Kh4V28680@makai.watson.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200610042043.k94Kh4V28680@makai.watson.ibm.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00023.txt.bz2 On Wed, Oct 04, 2006 at 04:43:04PM -0400, David Edelsohn wrote: > >>>>> Daniel Jacobowitz writes: > > >> From reading the PPC64 Platform ABI at > >> http://www.freestandards.org/spec/ELF/ppc64/PPC-elf64abi-1.9.html > >> ( see section 3.1.7) it appears that on Big Endian machines, > >> values are left aligned. But looks like GCC has different rules and right > >> aligns the values which are put on the > >> registers. This matches Andrew Cagney comment in the code, that says that > >> ABI specifies that the values > >> should be left aligned. But like I said in my earlier note, GCC appears to > >> want the values to be > >> right aligned. Would appreciate another set of eyes looking at it as I > >> don't have too much experience > >> in this area. > > The PPC64 Linux ABI changed. AIX always pads upwards. PPC64 > Linux pads aggregates smaller than a doubleword downward. > > "An aggregate or union smaller than one doubleword in size is padded so > that it appears in the least significant bits of the doubleword. All > others are padded, if necessary, at their tail." Thank you (and thanks to Andreas for answering, too). In that case, the Linux and AIX configurations ought to be calling different functions here. Janani, if you want to try to fix this, I would recommend: - Rename the existing function. Add an argument to it, is_linux. - Create a wrapper function with the old name, in the same file, for AIX to use. - Create a wrapper function in ppc-linux-tdep.c which calls it with is_linux == 1. - Call set_gdbarch_push_dummy_call in the PPC64 section of ppc_linux_init_abi. -- Daniel Jacobowitz CodeSourcery