elfcpp/
[deliverable/binutils-gdb.git] / gold / archive.cc
index 6a1e3b944b6a9de453e1b6169ef11009ed29f006..4db813d6dffa4f29ee8e54d42e5e3b865baa29aa 100644 (file)
@@ -104,6 +104,11 @@ Library_base::should_include_member(Symbol_table* symtab, Layout* layout,
           *why = "-u ";
           *why += sym_name;
         }
+      else if (parameters->options().is_export_dynamic_symbol(sym_name))
+        {
+          *why = "--export-dynamic-symbol ";
+          *why += sym_name;
+        }
       else if (layout->script_options()->is_referenced(sym_name))
        {
          size_t alc = 100 + strlen(sym_name);
@@ -113,6 +118,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 +184,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 +658,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 +854,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)
This page took 0.023195 seconds and 4 git commands to generate.