From 3a399523668c16bb10b42221f278c1cebf812f93 Mon Sep 17 00:00:00 2001 From: Steve Chamberlain Date: Wed, 17 Apr 1991 00:50:19 +0000 Subject: [PATCH] Better error messages for forward and undefined refs for ADDR and SIZEOF --- ld/ldexp.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ld/ldexp.c b/ld/ldexp.c index 5d12c4656b4..a287e5860cb 100644 --- a/ld/ldexp.c +++ b/ld/ldexp.c @@ -142,14 +142,17 @@ bfd_vma value; return new; } -static void check(os) -lang_output_section_statement_type *os; +static void +DEFUN(check, (os, name, op), + lang_output_section_statement_type *os AND + CONST char *name AND + CONST char *op) { if (os == (lang_output_section_statement_type *)NULL) { - info("%F%P undefined section"); + info("%F%P %s uses undefined section %s\n", op, name); } if (os->processed == false) { - info("%F%P forward reference of section"); + info("%F%P %s forward reference of section %s\n",op, name); } } @@ -331,7 +334,7 @@ bfd_vma dot; if (allocation_done != lang_first_phase_enum) { lang_output_section_statement_type *os = lang_output_section_find(tree->name.name); - check(os); + check(os,tree->name.name,"ADDR"); result = new_rel((bfd_vma)0, os); } else { @@ -342,7 +345,7 @@ bfd_vma dot; if(allocation_done != lang_first_phase_enum) { lang_output_section_statement_type *os = lang_output_section_find(tree->name.name); - check(os); + check(os,tree->name.name,"SIZEOF"); result = new_abs((bfd_vma)(os->bfd_section->size)); } else { -- 2.30.2