Check R_386_GOT32/R_386_GOT32X without base register
[deliverable/binutils-gdb.git] / gold / dynobj.cc
index 8bf6251f74b1ba0bafea6da90bc91faa76bc779a..9ab6bf885919a846b077395443c42dd17ffa8202 100644 (file)
@@ -374,6 +374,17 @@ Sized_dynobj<size, big_endian>::base_read_symbols(Read_symbols_data* sd)
   sd->verneed_size = 0;
   sd->verneed_info = 0;
 
+  const unsigned char* namesu = sd->section_names->data();
+  const char* names = reinterpret_cast<const char*>(namesu);
+  if (memmem(names, sd->section_names_size, ".zdebug_", 8) != NULL)
+    {
+      Compressed_section_map* compressed_sections =
+         build_compressed_section_map<size, big_endian>(
+             pshdrs, this->shnum(), names, sd->section_names_size, this, true);
+      if (compressed_sections != NULL)
+        this->set_compressed_sections(compressed_sections);
+    }
+
   if (this->dynsym_shndx_ != -1U)
     {
       // Get the dynamic symbols.
@@ -1488,6 +1499,10 @@ Versions::record_version(const Symbol_table* symtab,
   gold_assert(!this->is_finalized_);
   gold_assert(sym->version() != NULL);
 
+  // A symbol defined as "sym@" is bound to an unspecified base version.
+  if (sym->version()[0] == '\0')
+    return;
+
   Stringpool::Key version_key;
   const char* version = dynpool->add(sym->version(), false, &version_key);
 
@@ -1720,15 +1735,17 @@ Versions::symbol_section_contents(const Symbol_table* symtab,
     {
       unsigned int version_index;
       const char* version = (*p)->version();
-      if (version != NULL)
-       version_index = this->version_index(symtab, dynpool, *p);
-      else
+      if (version == NULL)
        {
          if ((*p)->is_defined() && !(*p)->is_from_dynobj())
            version_index = elfcpp::VER_NDX_GLOBAL;
          else
            version_index = elfcpp::VER_NDX_LOCAL;
        }
+      else if (version[0] == '\0')
+        version_index = elfcpp::VER_NDX_GLOBAL;
+      else
+       version_index = this->version_index(symtab, dynpool, *p);
       // If the symbol was defined as foo@V1 instead of foo@@V1, add
       // the hidden bit.
       if ((*p)->version() != NULL && !(*p)->is_default())
This page took 0.023546 seconds and 4 git commands to generate.