* symfile.c (place_section): Correct retry logic.
authorDaniel Jacobowitz <drow@false.org>
Mon, 20 Feb 2006 15:02:10 +0000 (15:02 +0000)
committerDaniel Jacobowitz <drow@false.org>
Mon, 20 Feb 2006 15:02:10 +0000 (15:02 +0000)
gdb/ChangeLog
gdb/symfile.c

index 7040b481614c89d535455fcd064ea1db8d01681f..d09fe9b39fa843746e1c271c38ebc9447c9981e9 100644 (file)
@@ -1,3 +1,7 @@
+2006-02-20  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * symfile.c (place_section): Correct retry logic.
+
 2006-02-19  Christopher Faylor  <cgf@timesys.com>
 
        * win32_nat.c (cygwin_load_start): New variable.
index e63ee53053129f76b9afe79b0abd4d1cd274dc9c..2a35e34afb175ad0ac994c009838cbf4f960d1f0 100644 (file)
@@ -476,6 +476,7 @@ place_section (bfd *abfd, asection *sect, void *obj)
   struct place_section_arg *arg = obj;
   CORE_ADDR *offsets = arg->offsets->offsets, start_addr;
   int done;
+  ULONGEST align = ((ULONGEST) 1) << bfd_get_section_alignment (abfd, sect);
 
   /* We are only interested in loadable sections.  */
   if ((bfd_get_section_flags (abfd, sect) & SEC_LOAD) == 0)
@@ -486,11 +487,11 @@ place_section (bfd *abfd, asection *sect, void *obj)
     return;
 
   /* Otherwise, let's try to find a place for the section.  */
+  start_addr = (arg->lowest + align - 1) & -align;
+
   do {
     asection *cur_sec;
-    ULONGEST align = 1 << bfd_get_section_alignment (abfd, sect);
 
-    start_addr = (arg->lowest + align - 1) & -align;
     done = 1;
 
     for (cur_sec = abfd->sections; cur_sec != NULL; cur_sec = cur_sec->next)
@@ -524,7 +525,7 @@ place_section (bfd *abfd, asection *sect, void *obj)
            start_addr = offsets[indx] + bfd_get_section_size (cur_sec);
            start_addr = (start_addr + align - 1) & -align;
            done = 0;
-           continue;
+           break;
          }
 
        /* Otherwise, we appear to be OK.  So far.  */
This page took 0.037565 seconds and 4 git commands to generate.