From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9922 invoked by alias); 6 Oct 2003 22:19:33 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9911 invoked from network); 6 Oct 2003 22:19:32 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 6 Oct 2003 22:19:32 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 0B6F92B89; Mon, 6 Oct 2003 18:19:31 -0400 (EDT) Message-ID: <3F81EA72.4030601@redhat.com> Date: Mon, 06 Oct 2003 22:19:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [rfa:ppc64] Fix 64-bit PPC ELF function calls References: <3F6E368C.30009@redhat.com> <3F6F388D.5020706@redhat.com> <1031003212231.ZM26624@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-10/txt/msg00134.txt.bz2 > Sorry for not replying sooner. I thought I had replied to this already... > > On Sep 22, 1:59pm, Andrew Cagney wrote: > > >> > PS: The apparent bugs are: >> > >> > - small odd structs get passed in memory instead of a register >> > (ref structs.exp:Fun3). >> > - small even structs get passed right, instead of left, aligned in >> > the register (ref structs.exp:Fun[12]). > > > These are all GCC bugs, right? And, if they get fixed in GCC, then GDB > will be broken? Yes, as far as I know (but you would be wize to cross check my interpretation of the ABI). No. The patch gets around the problem thus: + /* WARNING: cagney/2003-09-21: As best I can + tell, the ABI specifies that the value should + be left aligned. Unfortunatly, GCC doesn't + do this - it instead right aligns even sized + values and puts odd sized values on the + stack. Work around that by putting both a + left and right aligned value into the + register (hopefully no one notices :-^). + Arrrgh! */ >> > PS: Backtraces are a bit sick. > > > In what way? They don't work. All the backtrace tests I glanced at failed (and this is independant of the current fixes). >> > PPS: Oh, note the "hack" to find the TOC from the function's >> > entry point address. Without it malloc() fails. > > > Calls to other library functions would fail too. > > Is the TOC symbol name vs entry point name (i.e, FN vs..FN) convention > mandated by the ABI, or is this something that's Linux specific? It in the 64-bit ELF ABI. > I notice some 80+ character lines in ppc64_sysv_abi_push_dummy_call(). > Could you adjust these so that they're 80 characters or less? I'll run the file through gdb_indent.sh, as a separate commit. > Also, a minor nit: in the comment... > > /* Find a value for the TOC register. Every symbol should have both > ".FN" and "FN" in the minimal symbol table. "FN" points at the > F's descriptor, while ".FN" points at the entry point (which > matches FUNC_ADDR). Need to reverse from FUNC_ADDR back to the > FN's descriptor address. */ > > ...at the beginning of the third line down, shouldn't that be: > > FN's descriptor, [...] > > If not, what does `F' refer to? It's a tipo, thanks. The term "FN" is used in the ABI. ok? Andrew