aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-03-14 12:29:13 +0000
committerAlan Modra <amodra@gmail.com>2005-03-14 12:29:13 +0000
commit8b3d8fa8ac39a5cd9e127153b6cd32bb52d4ade2 (patch)
tree93e7ef2b3029870d0ef36fa58834ffa707962d12 /ld
parent4f495e616ddf03ac1c8cbb350cec2e292d9662b1 (diff)
downloadfsf-binutils-gdb-8b3d8fa8ac39a5cd9e127153b6cd32bb52d4ade2.zip
fsf-binutils-gdb-8b3d8fa8ac39a5cd9e127153b6cd32bb52d4ade2.tar.gz
fsf-binutils-gdb-8b3d8fa8ac39a5cd9e127153b6cd32bb52d4ade2.tar.bz2
* ldexp.c (exp_fold_tree): Ensure return value is initialized.
Tidy etree_assert case.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldexp.c15
2 files changed, 12 insertions, 8 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 6b1fbd3..1eb4050 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,10 @@
2005-03-14 Alan Modra <amodra@bigpond.net.au>
+ * ldexp.c (exp_fold_tree): Ensure return value is initialized.
+ Tidy etree_assert case.
+
+2005-03-14 Alan Modra <amodra@bigpond.net.au>
+
* po/tr.po: Commit new Turkish translation.
2005-03-11 Daniel Jacobowitz <dan@codesourcery.com>
diff --git a/ld/ldexp.c b/ld/ldexp.c
index ec25557..b194bec 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -699,7 +699,7 @@ exp_fold_tree (etree_type *tree,
if (tree == NULL)
{
- result.valid_p = FALSE;
+ memset (&result, 0, sizeof (result));
return result;
}
@@ -711,7 +711,7 @@ exp_fold_tree (etree_type *tree,
case etree_rel:
if (allocation_done != lang_final_phase_enum)
- result.valid_p = FALSE;
+ memset (&result, 0, sizeof (result));
else
result = new_rel ((tree->rel.value
+ tree->rel.section->output_section->vma
@@ -724,12 +724,8 @@ exp_fold_tree (etree_type *tree,
result = exp_fold_tree (tree->assert_s.child,
current_section,
allocation_done, dot, dotp);
- if (result.valid_p)
- {
- if (! result.value)
- einfo ("%X%P: %s\n", tree->assert_s.message);
- return result;
- }
+ if (result.valid_p && !result.value)
+ einfo ("%X%P: %s\n", tree->assert_s.message);
break;
case etree_unary:
@@ -787,6 +783,8 @@ exp_fold_tree (etree_type *tree,
}
}
}
+ else
+ memset (&result, 0, sizeof (result));
}
else
{
@@ -839,6 +837,7 @@ exp_fold_tree (etree_type *tree,
default:
FAIL ();
+ memset (&result, 0, sizeof (result));
break;
}