aboutsummaryrefslogtreecommitdiff
path: root/gold/merge.cc
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <rafael.espindola@gmail.com>2015-03-23 09:16:49 -0400
committerRafael Ávila de Espíndola <rafael.espindola@gmail.com>2015-03-23 09:16:49 -0400
commit67f95b96b4d5e8e19520d94bebae92db2f67af74 (patch)
treec98a68289748714bf336f1e5797718ce3e27cbca /gold/merge.cc
parent99067e2973a6bb1d3a52caafb479ebdc1a420580 (diff)
downloadfsf-binutils-gdb-67f95b96b4d5e8e19520d94bebae92db2f67af74.zip
fsf-binutils-gdb-67f95b96b4d5e8e19520d94bebae92db2f67af74.tar.gz
fsf-binutils-gdb-67f95b96b4d5e8e19520d94bebae92db2f67af74.tar.bz2
Remove is_merge_section_for.
Now that Input_merge_map has an Output_section_data, we can use it in implementing find_merge_section and replace the only use of is_merge_section_for with it.
Diffstat (limited to 'gold/merge.cc')
-rw-r--r--gold/merge.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/gold/merge.cc b/gold/merge.cc
index 5d93c74..a579445 100644
--- a/gold/merge.cc
+++ b/gold/merge.cc
@@ -45,8 +45,8 @@ Object_merge_map::~Object_merge_map()
// Get the Input_merge_map to use for an input section, or NULL.
-Object_merge_map::Input_merge_map*
-Object_merge_map::get_input_merge_map(unsigned int shndx)
+const Object_merge_map::Input_merge_map*
+Object_merge_map::get_input_merge_map(unsigned int shndx) const
{
gold_assert(shndx != -1U);
if (shndx == this->first_shnum_)
@@ -179,12 +179,13 @@ Object_merge_map::get_output_offset(unsigned int shndx,
// Return whether this is the merge map for section SHNDX.
-bool
-Object_merge_map::is_merge_section_for(const Output_section_data* output_data,
- unsigned int shndx)
-{
- Input_merge_map* map = this->get_input_merge_map(shndx);
- return map != NULL && map->output_data == output_data;
+const Output_section_data*
+Object_merge_map::find_merge_section(unsigned int shndx) const {
+ const Object_merge_map::Input_merge_map* map =
+ this->get_input_merge_map(shndx);
+ if (map == NULL)
+ return NULL;
+ return map->output_data;
}
// Initialize a mapping from input offsets to output addresses.