summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-02-20 15:02:10 +0000
committerDaniel Jacobowitz <drow@false.org>2006-02-20 15:02:10 +0000
commit3bd72c6f17a8488ebe6394e7276c25fc0e08ffad (patch)
tree37abbe4d66be0245bb3aac7cc37bc683c9e18bfc
parentc52c6897251ab8856c7d51beba74c35fa0f3807e (diff)
downloadbinutils-gdb-3bd72c6f17a8488ebe6394e7276c25fc0e08ffad.tar.gz
* symfile.c (place_section): Correct retry logic.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/symfile.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7040b481614..d09fe9b39fa 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/symfile.c b/gdb/symfile.c
index e63ee530531..2a35e34afb1 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -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. */