From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23698 invoked by alias); 10 Sep 2002 16:25:10 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 23684 invoked from network); 10 Sep 2002 16:25:09 -0000 Received: from unknown (HELO cygnus.equallogic.com) (65.170.102.10) by sources.redhat.com with SMTP; 10 Sep 2002 16:25:09 -0000 Received: from cygnus.equallogic.com (localhost.localdomain [127.0.0.1]) by cygnus.equallogic.com (8.11.6/8.11.6) with ESMTP id g8AGP8N25239; Tue, 10 Sep 2002 12:25:08 -0400 Received: from deneb.dev.equallogic.com (deneb.dev.equallogic.com [172.16.1.99]) by cygnus.equallogic.com (8.11.6/8.11.6) with ESMTP id g8AGP7k25230; Tue, 10 Sep 2002 12:25:07 -0400 Received: from pkoning.dev.equallogic.com.equallogic.com (localhost.localdomain [127.0.0.1]) by deneb.dev.equallogic.com (8.11.6/8.11.6) with ESMTP id g8AGP7f03945; Tue, 10 Sep 2002 12:25:07 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15742.7395.283716.741672@pkoning.dev.equallogic.com> Date: Tue, 10 Sep 2002 09:25:00 -0000 From: Paul Koning To: fnf@intrinsity.com Cc: binutils@sources.redhat.com, gdb@sources.redhat.com Subject: Re: MIPS sign extension of addresses References: <200209101549.g8AFnIb24401@beeville.vert.intrinsity.com> X-SW-Source: 2002-09/txt/msg00080.txt.bz2 >>>>> "Fred" == Fred Fish writes: Fred> I'm currently working on a mipsisa32-elf based toolchain and Fred> was concerned about the number of failures in the gdb Fred> testsuite. Fred> ...Most of the problems I fixed had to do with the fact that BFD Fred> takes the 32 bit unsigned addresses from object and executable Fred> files, sign extends them, and then stores the result as a Fred> bfd_vma, which is an unsigned 64 bit type (unsigned long long). Fred> For example, the unsigned 32 bit address 0x80020004 becomes an Fred> unsigned 64 bit bfd_vma/CORE_ADDR of 0xffffffff80020004. The Fred> bfd_vma type is used to define gdb's CORE_ADDR types. Fred> ...After getting a little feedback from some private email Fred> exchanges containing substantially the same info as above, I've Fred> modified my mental picture of this process to think of it as a Fred> simple address translation scheme. I.E. when running a 32 bit Fred> binary in a 64 bit address space, effectively the 32 bit Fred> address space is split in half, with the lower half Fred> (0x00000000-0x7FFFFFFF) mapped to the bottom of the 64 bit Fred> space and the upper half (0x80000000-0xFFFFFFFF) mapped to the Fred> top of the 64 bit space. That sounds right. I looked in the MIPS Inc. reference (MIPS64 architecture, part 3, privileged architecture, MD00091-2B-MIPS64PRA-AFP-00.95.pdf) and it shows exactly the picture you describe. For example, kseg0 starts at 0xffffffff80000000 in 64 bit addressing. paul