Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sourceware.org
Subject: Re: RFC: Fix an infinite loop placing sections in relocatable objects
Date: Thu, 16 Feb 2006 22:24:00 -0000	[thread overview]
Message-ID: <20060216222443.GA1582@nevyn.them.org> (raw)
In-Reply-To: <8f2776cb0602161423m743b170h46b0aa232b2191d1@mail.gmail.com>

On Thu, Feb 16, 2006 at 02:23:47PM -0800, Jim Blandy wrote:
> On 2/16/06, Daniel Jacobowitz <drow@false.org> 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


  reply	other threads:[~2006-02-16 22:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-16 15:24 Daniel Jacobowitz
2006-02-16 19:16 ` Jim Blandy
2006-02-16 22:04 ` Andreas Schwab
2006-02-16 22:17   ` Daniel Jacobowitz
2006-02-16 22:23     ` Jim Blandy
2006-02-16 22:24       ` Daniel Jacobowitz [this message]
2006-02-20 15:03 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060216222443.GA1582@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox