+
+ // Read the section headers.
+ const unsigned char* const pshdrs = this->get_view(shoff, shnum * shdr_size,
+ true, false);
+
+ // Read the section names.
+ const unsigned char* pshdrnames =
+ pshdrs + this->elf_file_.shstrndx() * shdr_size;
+ typename elfcpp::Shdr<size, big_endian> shdrnames(pshdrnames);
+ if (shdrnames.get_sh_type() != elfcpp::SHT_STRTAB)
+ this->error(_("section name section has wrong type: %u"),
+ static_cast<unsigned int>(shdrnames.get_sh_type()));
+ section_size_type section_names_size =
+ convert_to_section_size_type(shdrnames.get_sh_size());
+ const unsigned char* namesu = this->get_view(shdrnames.get_sh_offset(),
+ section_names_size, false,
+ false);
+ const char* names = reinterpret_cast<const char*>(namesu);
+
+ Compressed_section_map* compressed_sections =
+ build_compressed_section_map<size, big_endian>(
+ pshdrs, this->shnum(), names, section_names_size, this, true);
+ if (compressed_sections != NULL && !compressed_sections->empty())
+ this->set_compressed_sections(compressed_sections);