// script.cc -- handle linker scripts for gold.
-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
{
if (provide || hidden)
gold_error(_("invalid use of PROVIDE for dot symbol"));
- if (!this->script_sections_.in_sections_clause())
- gold_error(_("invalid assignment to dot outside of SECTIONS"));
- else
- this->script_sections_.add_dot_assignment(value);
+
+ // The GNU linker permits assignments to dot outside of SECTIONS
+ // clauses and treats them as occurring inside, so we don't
+ // check in_sections_clause here.
+ this->script_sections_.add_dot_assignment(value);
}
}
Position_dependent_options posdep = cmdline->position_dependent_options();
if (posdep.format_enum() == General_options::OBJECT_FORMAT_BINARY)
posdep.set_format_enum(General_options::OBJECT_FORMAT_ELF);
- Input_file_argument input_argument(filename, false, "", false, posdep);
+ Input_file_argument input_argument(filename,
+ Input_file_argument::INPUT_FILE_TYPE_FILE,
+ "", false, posdep);
Input_file input_file(&input_argument);
int dummy = 0;
if (!input_file.open(dirsearch, task, &dummy))
}
}
- Input_file_argument file(name_string.c_str(), false, extra_search_path,
- false, closure->position_dependent_options());
+ Input_file_argument file(name_string.c_str(),
+ Input_file_argument::INPUT_FILE_TYPE_FILE,
+ extra_search_path, false,
+ closure->position_dependent_options());
closure->inputs()->add_file(file);
}
yyerror(closurev, _("unknown PHDR type (try integer)"));
return elfcpp::PT_NULL;
}
+
+extern "C" void
+script_saw_segment_start_expression(void* closurev)
+{
+ Parser_closure* closure = static_cast<Parser_closure*>(closurev);
+ Script_sections* ss = closure->script_options()->script_sections();
+ ss->set_saw_segment_start_expression(true);
+}