+ {
+ const int len = (p->first.length + 1) * sizeof(Stringpool_char);
+ const section_offset_type offset = this->key_to_offset_[p->second - 1];
+ gold_assert(static_cast<section_size_type>(offset) + len
+ <= this->strtab_size_);
+ memcpy(buffer + offset, p->first.string, len);
+ }
+}
+
+// Write the ELF strtab into the output file at the specified offset.
+
+template<typename Stringpool_char>
+void
+Stringpool_template<Stringpool_char>::write(Output_file* of, off_t offset)
+{
+ gold_assert(this->strtab_size_ != 0);
+ unsigned char* view = of->get_output_view(offset, this->strtab_size_);
+ this->write_to_buffer(view, this->strtab_size_);
+ of->write_output_view(offset, this->strtab_size_, view);
+}
+
+// Print statistical information to stderr. This is used for --stats.
+
+template<typename Stringpool_char>
+void
+Stringpool_template<Stringpool_char>::print_stats(const char* name) const
+{
+#if defined(HAVE_UNORDERED_MAP) || defined(HAVE_TR1_UNORDERED_MAP) || defined(HAVE_EXT_HASH_MAP)
+ fprintf(stderr, _("%s: %s entries: %zu; buckets: %zu\n"),
+ program_name, name, this->string_set_.size(),
+ this->string_set_.bucket_count());
+#else
+ fprintf(stderr, _("%s: %s entries: %zu\n"),
+ program_name, name, this->table_.size());
+#endif
+ fprintf(stderr, _("%s: %s Stringdata structures: %zu\n"),
+ program_name, name, this->strings_.size());