* gdb.base/default.exp (show version): Update the version text.
[binutils-gdb.git] / gold / symtab.cc
index 01e000d874e7da7bec5377cb2fb3881968427ee5..68ce3b1efeeaae6287d9a3d3cc3e430775206b0e 100644 (file)
@@ -31,6 +31,7 @@ Symbol::init_fields(const char* name, const char* version,
   this->symtab_index_ = 0;
   this->dynsym_index_ = 0;
   this->got_offset_ = 0;
+  this->plt_offset_ = 0;
   this->type_ = type;
   this->binding_ = binding;
   this->visibility_ = visibility;
@@ -42,6 +43,7 @@ Symbol::init_fields(const char* name, const char* version,
   this->in_reg_ = false;
   this->in_dyn_ = false;
   this->has_got_offset_ = false;
+  this->has_plt_offset_ = false;
   this->has_warning_ = false;
 }
 
@@ -265,6 +267,10 @@ Symbol_table::resolve(Sized_symbol<size>* to, const Sized_symbol<size>* from,
   esym.put_st_other(from->visibility(), from->nonvis());
   esym.put_st_shndx(from->shndx());
   Symbol_table::resolve(to, esym.sym(), from->object(), version);
+  if (from->in_reg())
+    to->set_in_reg();
+  if (from->in_dyn())
+    to->set_in_dyn();
 }
 
 // Add one symbol from OBJECT to the symbol table.  NAME is symbol
@@ -1001,7 +1007,10 @@ Symbol_table::set_dynsym_indexes(const General_options* options,
       // some symbols appear more than once in the symbol table, with
       // and without a version.
 
-      if (!sym->needs_dynsym_entry())
+      if (!sym->needs_dynsym_entry()
+          && (!options->export_dynamic()
+              || !sym->in_reg()
+              || !sym->is_externally_visible()))
        sym->set_dynsym_index(-1U);
       else if (!sym->has_dynsym_index())
        {