gdb/testsuite/
[binutils-gdb.git] / gold / script.cc
index 11e4612905c4ba837d63a92418163d82c6a251ff..2cdaae6384e5f5e9dbd6472029292219a6cdca0c 100644 (file)
@@ -955,7 +955,7 @@ Symbol_assignment::sized_finalize(Symbol_table* symtab, const Layout* layout,
   uint64_t final_val = this->val_->eval_maybe_dot(symtab, layout, true,
                                                  is_dot_available,
                                                  dot_value, dot_section,
-                                                 &section);
+                                                 &section, NULL);
   Sized_symbol<size>* ssym = symtab->get_sized_symbol<size>(this->sym_);
   ssym->set_value(final_val);
   if (section != NULL)
@@ -974,7 +974,7 @@ Symbol_assignment::set_if_absolute(Symbol_table* symtab, const Layout* layout,
   Output_section* val_section;
   uint64_t val = this->val_->eval_maybe_dot(symtab, layout, false,
                                            is_dot_available, dot_value,
-                                           NULL, &val_section);
+                                           NULL, &val_section, NULL);
   if (val_section != NULL)
     return;
 
@@ -2593,6 +2593,24 @@ script_add_file(void* closurev, const char* name, size_t length)
   closure->inputs()->add_file(file);
 }
 
+// Called by the bison parser to add a library to the link.
+
+extern "C" void
+script_add_library(void* closurev, const char* name, size_t length)
+{
+  Parser_closure* closure = static_cast<Parser_closure*>(closurev);
+  std::string name_string(name, length);
+
+  if (name_string[0] != 'l')
+    gold_error(_("library name must be prefixed with -l"));
+    
+  Input_file_argument file(name_string.c_str() + 1,
+                          Input_file_argument::INPUT_FILE_TYPE_LIBRARY,
+                          "", false,
+                          closure->position_dependent_options());
+  closure->inputs()->add_file(file);
+}
+
 // Called by the bison parser to start a group.  If we are already in
 // a group, that means that this script was invoked within a
 // --start-group --end-group sequence on the command line, or that
@@ -2767,7 +2785,7 @@ script_add_search_dir(void* closurev, const char* option, size_t length)
     gold_warning(_("%s:%d:%d: ignoring SEARCH_DIR; SEARCH_DIR is only valid"
                   " for scripts specified via -T/--script"),
                 closure->filename(), closure->lineno(), closure->charpos());
-  else
+  else if (!closure->command_line()->options().nostdlib())
     {
       std::string s = "-L" + std::string(option, length);
       script_parse_option(closurev, s.c_str(), s.size());