aboutsummaryrefslogtreecommitdiff
path: root/ld/ldexp.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-09-07 06:27:36 +0000
committerAlan Modra <amodra@gmail.com>2005-09-07 06:27:36 +0000
commit5397b1fec1826b95710fb0fb9bb4b0386a18c4a7 (patch)
tree94f7fe3f64952f01c76ee15908695a059e9d1ff1 /ld/ldexp.c
parent12b9ff6c8bf7bd8040dfdd5a05bcf24672b30b3e (diff)
downloadgdb-5397b1fec1826b95710fb0fb9bb4b0386a18c4a7.zip
gdb-5397b1fec1826b95710fb0fb9bb4b0386a18c4a7.tar.gz
gdb-5397b1fec1826b95710fb0fb9bb4b0386a18c4a7.tar.bz2
* ldexp.c (fold_name <SIZEOF>): Return 0 for non-existent section.
(exp_fold_tree_1): Print assert message only in final stage of linking. Trigger assertion failure if expression cannot be evaluated.
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r--ld/ldexp.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/ld/ldexp.c b/ld/ldexp.c
index d0ecb0c..8ae7446 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -590,7 +590,9 @@ fold_name (etree_type *tree)
lang_output_section_statement_type *os;
os = lang_output_section_find (tree->name.name);
- if (os != NULL && os->processed > 0)
+ if (os == NULL)
+ new_abs (0);
+ else if (os->processed > 0)
new_abs (os->bfd_section->size / opb);
}
break;
@@ -655,15 +657,8 @@ exp_fold_tree_1 (etree_type *tree)
case etree_assert:
exp_fold_tree_1 (tree->assert_s.child);
- if (expld.result.valid_p)
- {
- if (expld.phase == lang_mark_phase_enum)
- /* We don't care if assert fails or not when we are just
- marking if a section is used or not. */
- expld.result.value = 1;
- else if (!expld.result.value)
- einfo ("%X%P: %s\n", tree->assert_s.message);
- }
+ if (expld.phase == lang_final_phase_enum && !expld.result.value)
+ einfo ("%X%P: %s\n", tree->assert_s.message);
break;
case etree_unary: