This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: Fix an infinite loop placing sections in relocatable objects
On Thu, Feb 16, 2006 at 11:04:31PM +0100, Andreas Schwab wrote:
> Daniel Jacobowitz <drow@false.org> writes:
>
> > diff -u -p -r1.167 symfile.c
> > --- symfile.c 7 Feb 2006 19:40:30 -0000 1.167
> > +++ symfile.c 16 Feb 2006 15:21:43 -0000
> > @@ -476,6 +476,7 @@ place_section (bfd *abfd, asection *sect
> > struct place_section_arg *arg = obj;
> > CORE_ADDR *offsets = arg->offsets->offsets, start_addr;
> > int done;
> > + 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?
--
Daniel Jacobowitz
CodeSourcery