aboutsummaryrefslogtreecommitdiff
path: root/gold/script.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/script.cc')
-rw-r--r--gold/script.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/gold/script.cc b/gold/script.cc
index fb1b2e1..53919e6 100644
--- a/gold/script.cc
+++ b/gold/script.cc
@@ -1398,6 +1398,9 @@ read_input_script(Workqueue* workqueue, Symbol_table* symtab, Layout* layout,
&lex,
input_file->will_search_for());
+ bool old_saw_sections_clause =
+ layout->script_options()->saw_sections_clause();
+
if (yyparse(&closure) != 0)
{
if (closure.found_incompatible_target())
@@ -1411,6 +1414,12 @@ read_input_script(Workqueue* workqueue, Symbol_table* symtab, Layout* layout,
return false;
}
+ if (!old_saw_sections_clause
+ && layout->script_options()->saw_sections_clause()
+ && layout->have_added_input_section())
+ gold_error(_("%s: SECTIONS seen after other input files; try -T/--script"),
+ input_file->filename().c_str());
+
if (!closure.saw_inputs())
return true;