aboutsummaryrefslogtreecommitdiff
path: root/gold/merge.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-11-30 00:35:27 +0000
committerIan Lance Taylor <iant@google.com>2007-11-30 00:35:27 +0000
commit9a0910c33e1a6962d475ee0a994fd1f5e446a888 (patch)
treef30e7b369cc05383699fbe4780ee0839b8dbcdde /gold/merge.cc
parent71195202dfb59bb7b61b35dc4cc5d202fab12020 (diff)
downloadgdb-9a0910c33e1a6962d475ee0a994fd1f5e446a888.zip
gdb-9a0910c33e1a6962d475ee0a994fd1f5e446a888.tar.gz
gdb-9a0910c33e1a6962d475ee0a994fd1f5e446a888.tar.bz2
From Craig Silverstein: Add support for compressing .debug_str section.
Diffstat (limited to 'gold/merge.cc')
-rw-r--r--gold/merge.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/gold/merge.cc b/gold/merge.cc
index 726a972..215bc34 100644
--- a/gold/merge.cc
+++ b/gold/merge.cc
@@ -496,13 +496,12 @@ Output_merge_string<Char_type>::do_add_input_section(Relobj* object,
return true;
}
-// Set the final data size of a merged string section. This is where
-// we finalize the mappings from the input sections to the output
-// section.
+// Finalize the mappings from the input sections to the output
+// section, and return the final data size.
template<typename Char_type>
-void
-Output_merge_string<Char_type>::set_final_data_size()
+off_t
+Output_merge_string<Char_type>::finalize_merged_data()
{
this->stringpool_.set_string_offsets();
@@ -513,10 +512,18 @@ Output_merge_string<Char_type>::set_final_data_size()
this->add_mapping(p->object, p->shndx, p->offset, p->length,
this->stringpool_.get_offset(p->string));
- this->set_data_size(this->stringpool_.get_strtab_size());
-
// Save some memory.
this->merged_strings_.clear();
+
+ return this->stringpool_.get_strtab_size();
+}
+
+template<typename Char_type>
+void
+Output_merge_string<Char_type>::set_final_data_size()
+{
+ const off_t final_data_size = this->finalize_merged_data();
+ this->set_data_size(final_data_size);
}
// Write out a merged string section.