From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9414 invoked by alias); 11 Feb 2010 12:13:52 -0000 Received: (qmail 9398 invoked by uid 22791); 11 Feb 2010 12:13:51 -0000 X-SWARE-Spam-Status: No, hits=-6.5 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; Thu, 11 Feb 2010 12:13:47 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1BCDj59018360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2010 07:13:46 -0500 Received: from hase.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1BCDiGd002944; Thu, 11 Feb 2010 07:13:44 -0500 From: Andreas Schwab To: Jan Kratochvil Cc: binutils@sourceware.org, gdb-patches@sourceware.org Subject: Re: [patch] bfd/: bfd_elf_bfd_from_remote_memory 32bit &= 0xffffffff References: <20100211115730.GA7358@host0.dyn.jankratochvil.net> X-Yow: Is it 1974? What's for SUPPER? Can I spend my COLLEGE FUND in one wild afternoon?? Date: Thu, 11 Feb 2010 12:13:00 -0000 In-Reply-To: <20100211115730.GA7358@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Thu, 11 Feb 2010 12:57:30 +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/msg00284.txt.bz2 Jan Kratochvil writes: > --- a/bfd/elfcode.h > +++ b/bfd/elfcode.h > @@ -1745,6 +1745,8 @@ NAME(_bfd_elf,bfd_from_remote_memory) > if (!loadbase_set && (i_phdrs[i].p_offset & -i_phdrs[i].p_align) == 0) > { > loadbase = ehdr_vma - (i_phdrs[i].p_vaddr & -i_phdrs[i].p_align); > + if (ELFCLASS == ELFCLASS32) > + loadbase &= 0xffffffff; Some targets use signed addresses. Andreas. -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different."