Initial x32 support in gold
[deliverable/binutils-gdb.git] / gold / archive.cc
index 4aafb71664dc9ede13a72413a9f0bfb05d8658ea..c2e6ff63db2be11b184ddb0437dfb3a78214588f 100644 (file)
@@ -113,6 +113,11 @@ Library_base::should_include_member(Symbol_table* symtab, Layout* layout,
          *why = buf;
          delete[] buf;
        }
+      else if (strcmp(sym_name, parameters->entry()) == 0)
+       {
+         *why = "entry symbol ";
+         *why += sym_name;
+       }
       else
        return Library_base::SHOULD_INCLUDE_UNKNOWN;
     }
@@ -174,7 +179,8 @@ Archive::Archive(const std::string& name, Input_file* input_file,
   : Library_base(task), name_(name), input_file_(input_file), armap_(),
     armap_names_(), extended_names_(), armap_checked_(), seen_offsets_(),
     members_(), is_thin_archive_(is_thin_archive), included_member_(false),
-    nested_archives_(), dirpath_(dirpath), num_members_(0)
+    nested_archives_(), dirpath_(dirpath), num_members_(0),
+    included_all_members_(false)
 {
   this->no_export_ =
     parameters->options().check_excluded_libs(input_file->found_name());
@@ -647,7 +653,8 @@ Archive::get_elf_object_for_member(off_t off, bool* punconfigured)
     {
       Object* obj = parameters->options().plugins()->claim_file(input_file,
                                                                 memoff,
-                                                                memsize);
+                                                                memsize,
+                                                               NULL);
       if (obj != NULL)
         {
           // The input file was claimed by a plugin, and its symbols
@@ -842,6 +849,13 @@ bool
 Archive::include_all_members(Symbol_table* symtab, Layout* layout,
                              Input_objects* input_objects, Mapfile* mapfile)
 {
+  // Don't include the same archive twice.  This can happen if
+  // --whole-archive is nested inside --start-group (PR gold/12163).
+  if (this->included_all_members_)
+    return true;
+
+  this->included_all_members_ = true;
+
   input_objects->archive_start(this);
 
   if (this->members_.size() > 0)
@@ -960,7 +974,7 @@ Archive::include_member(Symbol_table* symtab, Layout* layout,
     {
       {
        if (layout->incremental_inputs() != NULL)
-         layout->incremental_inputs()->report_object(obj, this);
+         layout->incremental_inputs()->report_object(obj, 0, this, NULL);
        Read_symbols_data sd;
        obj->read_symbols(&sd);
        obj->layout(symtab, layout, &sd);
@@ -1040,7 +1054,12 @@ Add_archive_symbols::run(Workqueue* workqueue)
   // For an incremental link, begin recording layout information.
   Incremental_inputs* incremental_inputs = this->layout_->incremental_inputs();
   if (incremental_inputs != NULL)
-    incremental_inputs->report_archive_begin(this->archive_);
+    {
+      unsigned int arg_serial = this->input_argument_->file().arg_serial();
+      Script_info* script_info = this->input_argument_->script_info();
+      incremental_inputs->report_archive_begin(this->archive_, arg_serial,
+                                              script_info);
+    }
 
   bool added = this->archive_->add_symbols(this->symtab_, this->layout_,
                                           this->input_objects_,
@@ -1102,7 +1121,7 @@ Lib_group::Lib_group(const Input_file_lib* lib, Task* task)
 const std::string&
 Lib_group::do_filename() const
 {
-  std::string *filename = new std::string("<group>");
+  std::string *filename = new std::string("/group/");
   return *filename;
 }
 
@@ -1196,7 +1215,8 @@ Lib_group::include_member(Symbol_table* symtab, Layout* layout,
   if (input_objects->add_object(obj))
     {
       if (layout->incremental_inputs() != NULL)
-       layout->incremental_inputs()->report_object(obj, this);
+       layout->incremental_inputs()->report_object(obj, member.arg_serial_,
+                                                   this, NULL);
       obj->layout(symtab, layout, sd);
       obj->add_symbols(symtab, sd, layout);
     }
@@ -1256,7 +1276,7 @@ Add_lib_group_symbols::run(Workqueue*)
   // For an incremental link, begin recording layout information.
   Incremental_inputs* incremental_inputs = this->layout_->incremental_inputs();
   if (incremental_inputs != NULL)
-    incremental_inputs->report_archive_begin(this->lib_);
+    incremental_inputs->report_archive_begin(this->lib_, 0, NULL);
 
   this->lib_->add_symbols(this->symtab_, this->layout_, this->input_objects_);
 
This page took 0.025704 seconds and 4 git commands to generate.