From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17112 invoked by alias); 16 Feb 2006 22:24:46 -0000 Received: (qmail 17104 invoked by uid 22791); 16 Feb 2006 22:24:46 -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; Thu, 16 Feb 2006 22:24:45 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F9rYJ-0000Pp-E0 for gdb-patches@sourceware.org; Thu, 16 Feb 2006 17:24:43 -0500 Date: Thu, 16 Feb 2006 22:24:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Subject: Re: RFC: Fix an infinite loop placing sections in relocatable objects Message-ID: <20060216222443.GA1582@nevyn.them.org> Mail-Followup-To: gdb-patches@sourceware.org References: <20060216152444.GA22371@nevyn.them.org> <20060216221726.GA1137@nevyn.them.org> <8f2776cb0602161423m743b170h46b0aa232b2191d1@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f2776cb0602161423m743b170h46b0aa232b2191d1@mail.gmail.com> User-Agent: Mutt/1.5.8i 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-02/txt/msg00331.txt.bz2 On Thu, Feb 16, 2006 at 02:23:47PM -0800, Jim Blandy wrote: > On 2/16/06, Daniel Jacobowitz wrote: > > > > + ULONGEST align = 1 << bfd_get_section_alignment (abfd, sect); > > > > > > I think bfd_get_section_alignment can return values bigger than 31 in > > > general, and this is undefined in this case. > > > > It's only used in math with a CORE_ADDR, which will be the size of a > > bfd_vma. Can bfd_get_section_alignment return a shift greater than the > > size of a bfd_vma? What would that mean? > > No, what he means is that the literal "1" is just an 'int', so the > shift will be done in the width of an int. The conversion to ULONGEST > happens later. The fix is to cast the 1 to ULONGEST before shifting > it. Oh! Right. Thanks. -- Daniel Jacobowitz CodeSourcery