aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2003-06-27 13:11:17 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2003-06-27 13:11:17 +0000
commit1549f61969ead87d39a4ee3ddeda799a5d87e773 (patch)
treec2359a11ef706aa0e076ae1efbf2239e66ace86d /gdb
parent3cb3398dc3d81110d0b75a182b309042bc356b8a (diff)
downloadfsf-binutils-gdb-1549f61969ead87d39a4ee3ddeda799a5d87e773.zip
fsf-binutils-gdb-1549f61969ead87d39a4ee3ddeda799a5d87e773.tar.gz
fsf-binutils-gdb-1549f61969ead87d39a4ee3ddeda799a5d87e773.tar.bz2
2003-06-27 Elena Zannoni <ezannoni@redhat.com>
* symfile.c (syms_from_objfile): Move variables to inner block. Move the checks for the non-mainline case a bit earlier to avoid doing some useless computations.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/symfile.c15
2 files changed, 13 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 758a96b..3e454dd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2003-06-27 Elena Zannoni <ezannoni@redhat.com>
+ * symfile.c (syms_from_objfile): Move variables to inner block.
+ Move the checks for the non-mainline case a bit earlier to avoid
+ doing some useless computations.
+
+2003-06-27 Elena Zannoni <ezannoni@redhat.com>
+
* dwarfread.c (decode_modified_type): Gag new compiler warning.
2003-06-26 Elena Zannoni <ezannoni@redhat.com>
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 3b7ebc2..839a7bc 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -566,12 +566,8 @@ syms_from_objfile (struct objfile *objfile,
int mainline,
int verbo)
{
- asection *lower_sect;
- asection *sect;
- CORE_ADDR lower_offset;
struct section_addr_info *local_addr = NULL;
struct cleanup *old_chain;
- int i;
gdb_assert (! (addrs && offsets));
@@ -626,8 +622,13 @@ syms_from_objfile (struct objfile *objfile,
We no longer warn if the lowest section is not a text segment (as
happens for the PA64 port. */
- if (!mainline)
+ if (!mainline && addrs && addrs->other[0].name)
{
+ asection *lower_sect;
+ asection *sect;
+ CORE_ADDR lower_offset;
+ int i;
+
/* Find lowest loadable section to be used as starting point for
continguous sections. FIXME!! won't work without call to find
.text first, but this assumes text is lowest section. */
@@ -659,9 +660,7 @@ syms_from_objfile (struct objfile *objfile,
(the loadable section directly below it in memory).
this_offset = lower_offset = lower_addr - lower_orig_addr */
- /* Calculate offsets for sections. */
- if (addrs)
- for (i=0 ; i < addrs->num_sections && addrs->other[i].name; i++)
+ for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
{
if (addrs->other[i].addr != 0)
{