diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2007-01-06 22:03:46 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@codesourcery.com> | 2007-01-06 22:03:46 +0000 |
commit | cc3e2771c5def765623e1fb173f8211ddbe5ccb6 (patch) | |
tree | 58c3ada104bb4380a55083caa365178481eee8f5 /ld/ldexp.c | |
parent | 2e4dc0578090605ab0c5e5a097bbdf000a4cfc51 (diff) | |
download | gdb-cc3e2771c5def765623e1fb173f8211ddbe5ccb6.zip gdb-cc3e2771c5def765623e1fb173f8211ddbe5ccb6.tar.gz gdb-cc3e2771c5def765623e1fb173f8211ddbe5ccb6.tar.bz2 |
ld/
* ldexp.c (fold_name): Issue error on undefined sections.
ld/testsuite/
* ld-scripts/expr.exp: New.
* ld-scripts/expr1.s: New.
* ld-scripts/expr1.d: New.
* ld-scripts/expr1.t: New.
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r-- | ld/ldexp.c | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -563,7 +563,13 @@ fold_name (etree_type *tree) lang_output_section_statement_type *os; os = lang_output_section_find (tree->name.name); - if (os != NULL && os->processed_vma) + if (os == NULL) + { + if (expld.phase == lang_final_phase_enum) + einfo (_("%F%S: undefined section `%s' referenced in expression\n"), + tree->name.name); + } + else if (os->processed_vma) new_rel (0, NULL, os->bfd_section); } break; @@ -574,7 +580,13 @@ fold_name (etree_type *tree) lang_output_section_statement_type *os; os = lang_output_section_find (tree->name.name); - if (os != NULL && os->processed_lma) + if (os == NULL) + { + if (expld.phase == lang_final_phase_enum) + einfo (_("%F%S: undefined section `%s' referenced in expression\n"), + tree->name.name); + } + else if (os->processed_lma) { if (os->load_base == NULL) new_abs (os->bfd_section->lma); @@ -592,7 +604,12 @@ fold_name (etree_type *tree) os = lang_output_section_find (tree->name.name); if (os == NULL) - new_abs (0); + { + if (expld.phase == lang_final_phase_enum) + einfo (_("%F%S: undefined section `%s' referenced in expression\n"), + tree->name.name); + new_abs (0); + } else if (os->processed_vma) new_abs (os->bfd_section->size / opb); } |