* 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.
+2007-01-06 Nathan Sidwell <nathan@codesourcery.com>
+
+ * ldexp.c (fold_name): Issue error on undefined sections.
+
2007-01-02 Alan Modra <amodra@bigpond.net.au>
* pe-dll.c: Include pe-dll.h.
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;
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);
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);
}
+2007-01-06 Nathan Sidwell <nathan@codesourcery.com>
+
+ * ld-scripts/expr.exp: New.
+ * ld-scripts/expr1.s: New.
+ * ld-scripts/expr1.d: New.
+ * ld-scripts/expr1.t: New.
+
2006-12-29 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/wrap.exp: New file.
--- /dev/null
+# Test ALIGN in a linker script.
+# By Nathan Sidwell, CodeSourcery LLC
+# Copyright 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+
+run_dump_test expr1
--- /dev/null
+# ld: -T expr1.t
+# error: undefined section .* in expression
--- /dev/null
+ .word 0
+
--- /dev/null
+ENTRY(RAM)
+
+MEMORY
+{
+ ram (rwx) : ORIGIN = 0, LENGTH = 0x1000000
+}
+
+SECTIONS
+{
+.text : { } >ram
+}
+RAM = ADDR(ram);