From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23279 invoked by alias); 17 Feb 2010 18:50:51 -0000 Received: (qmail 23271 invoked by uid 22791); 17 Feb 2010 18:50:50 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Feb 2010 18:50:46 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1HIojtM028211 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 17 Feb 2010 13:50:45 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1HIohkt025899; Wed, 17 Feb 2010 13:50:44 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o1HIogK1011007; Wed, 17 Feb 2010 13:50:43 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id A2CD2379956; Wed, 17 Feb 2010 11:50:42 -0700 (MST) From: Tom Tromey To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch] bfd/: bfd_elf_bfd_from_remote_memory 32bit &= 0xffffffff References: <20100211115730.GA7358@host0.dyn.jankratochvil.net> <20100211124302.GA8435__38068.0548646071$1265892205$gmane$org@host0.dyn.jankratochvil.net> <20100217113400.GA19312@host0.dyn.jankratochvil.net> Reply-To: tromey@redhat.com Date: Wed, 17 Feb 2010 18:50:00 -0000 In-Reply-To: <20100217113400.GA19312@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Wed, 17 Feb 2010 12:34:00 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-02/txt/msg00434.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Tom> It seems like you could just call the struct CORE_ADDR. Jan> I thought it would be good to have different type for _address_ vs. for Jan> _displacement_. With this difference some math operations are no longer Jan> valid and I have discovered for example: Ok, I see. But in that case wouldn't you still need (or want) to make CORE_ADDR non-scalar, to avoid hidden errors? Jan> displacement used as address: invalid but used in Jan> read_type_unit_scope; it should get some cleanup (not investigated Jan> more). Yeah. There's a comment: /* start_symtab needs a low pc, but we don't really have one. Do what read_file_scope would do in the absence of such info. */ lowpc = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); Tom> Maybe I am being fuzzy today, but I don't follow the logic of this Tom> statement. Is this just because we don't expect "too much" overflow? Tom> Is it impossible for overflow to accumulate in a CORE_ADDR? Jan> In general "displacement + displacement" operation is invalid and thus it Jan> cannot overflow. Thanks. Tom