diff options
author | Rafael Ávila de Espíndola <rafael.espindola@gmail.com> | 2015-03-23 09:16:49 -0400 |
---|---|---|
committer | Rafael Ávila de Espíndola <rafael.espindola@gmail.com> | 2015-03-23 09:16:49 -0400 |
commit | 67f95b96b4d5e8e19520d94bebae92db2f67af74 (patch) | |
tree | c98a68289748714bf336f1e5797718ce3e27cbca /gold/output.h | |
parent | 99067e2973a6bb1d3a52caafb479ebdc1a420580 (diff) | |
download | gdb-67f95b96b4d5e8e19520d94bebae92db2f67af74.zip gdb-67f95b96b4d5e8e19520d94bebae92db2f67af74.tar.gz 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/output.h')
-rw-r--r-- | gold/output.h | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/gold/output.h b/gold/output.h index dc11c8f..318af36 100644 --- a/gold/output.h +++ b/gold/output.h @@ -2857,7 +2857,7 @@ class Output_section_lookup_maps public: Output_section_lookup_maps() : is_valid_(true), merge_sections_by_properties_(), - merge_sections_by_id_(), relaxed_input_sections_by_id_() + relaxed_input_sections_by_id_() { } // Whether the maps are valid. @@ -2875,7 +2875,6 @@ class Output_section_lookup_maps clear() { this->merge_sections_by_properties_.clear(); - this->merge_sections_by_id_.clear(); this->relaxed_input_sections_by_id_.clear(); // A cleared map is valid. this->is_valid_ = true; @@ -2892,17 +2891,6 @@ class Output_section_lookup_maps return p != this->merge_sections_by_properties_.end() ? p->second : NULL; } - // Find a merge section by section ID of a merge input section. Return NULL - // if none is found. - Output_merge_base* - find_merge_section(const Object* object, unsigned int shndx) const - { - gold_assert(this->is_valid_); - Merge_sections_by_id::const_iterator p = - this->merge_sections_by_id_.find(Const_section_id(object, shndx)); - return p != this->merge_sections_by_id_.end() ? p->second : NULL; - } - // Add a merge section pointed by POMB with properties MSP. void add_merge_section(const Merge_section_properties& msp, @@ -2914,19 +2902,6 @@ class Output_section_lookup_maps gold_assert(result.second); } - // Add a mapping from a merged input section in OBJECT with index SHNDX - // to a merge output section pointed by POMB. - void - add_merge_input_section(const Object* object, unsigned int shndx, - Output_merge_base* pomb) - { - Const_section_id csid(object, shndx); - std::pair<Const_section_id, Output_merge_base*> value(csid, pomb); - std::pair<Merge_sections_by_id::iterator, bool> result = - this->merge_sections_by_id_.insert(value); - gold_assert(result.second); - } - // Find a relaxed input section of OBJECT with index SHNDX. Output_relaxed_input_section* find_relaxed_input_section(const Object* object, unsigned int shndx) const @@ -2952,10 +2927,6 @@ class Output_section_lookup_maps } private: - typedef Unordered_map<Const_section_id, Output_merge_base*, - Const_section_id_hash> - Merge_sections_by_id; - typedef Unordered_map<Merge_section_properties, Output_merge_base*, Merge_section_properties::hash, Merge_section_properties::equal_to> @@ -2969,8 +2940,6 @@ class Output_section_lookup_maps bool is_valid_; // Merge sections by merge section properties. Merge_sections_by_properties merge_sections_by_properties_; - // Merge sections by section IDs. - Merge_sections_by_id merge_sections_by_id_; // Relaxed sections by section IDs. Relaxed_input_sections_by_id relaxed_input_sections_by_id_; }; @@ -3761,11 +3730,6 @@ class Output_section : public Output_data section_offset_type offset, section_offset_type* poutput) const; - // Return whether this is the merge section for the input section - // SHNDX in OBJECT. - bool - is_merge_section_for(const Relobj* object, unsigned int shndx) const; - // Write out the data. This does nothing for an input section. void write(Output_file*); @@ -4290,7 +4254,7 @@ class Output_section : public Output_data // Find the merge section into which an input section with index SHNDX in // OBJECT has been added. Return NULL if none found. - Output_section_data* + const Output_section_data* find_merge_section(const Relobj* object, unsigned int shndx) const; // Build a relaxation map. |