p != new_cies.end();
++p)
{
- uint64_t zero = 0;
if (p->second)
- this->cie_offsets_.insert(std::make_pair(p->first, zero));
+ this->cie_offsets_.insert(p->first);
else
- this->unmergeable_cie_offsets_.push_back(std::make_pair(p->first,
- zero));
+ this->unmergeable_cie_offsets_.push_back(p->first);
}
return true;
{
Cie_offsets::iterator find_cie = this->cie_offsets_.find(&cie);
if (find_cie != this->cie_offsets_.end())
- cie_pointer = find_cie->first;
+ cie_pointer = *find_cie;
else
{
// See if we already saw this CIE in this object file.
this->unmergeable_cie_offsets_.begin();
p != this->unmergeable_cie_offsets_.end();
++p)
- ret += p->first->fde_count();
+ ret += (*p)->fde_count();
for (Cie_offsets::const_iterator p = this->cie_offsets_.begin();
p != this->cie_offsets_.end();
++p)
- ret += p->first->fde_count();
+ ret += (*p)->fde_count();
return ret;
}
void
Eh_frame::set_final_data_size()
{
- off_t start_file_offset = this->offset();
section_offset_type output_offset = 0;
for (Unmergeable_cie_offsets::iterator p =
this->unmergeable_cie_offsets_.begin();
p != this->unmergeable_cie_offsets_.end();
++p)
- {
- p->second = start_file_offset + output_offset;
- output_offset = p->first->set_output_offset(output_offset,
- this->addralign(),
- &this->merge_map_);
- }
+ output_offset = (*p)->set_output_offset(output_offset,
+ this->addralign(),
+ &this->merge_map_);
for (Cie_offsets::iterator p = this->cie_offsets_.begin();
p != this->cie_offsets_.end();
++p)
- {
- p->second = start_file_offset + output_offset;
- output_offset = p->first->set_output_offset(output_offset,
- this->addralign(),
- &this->merge_map_);
- }
+ output_offset = (*p)->set_output_offset(output_offset,
+ this->addralign(),
+ &this->merge_map_);
gold_assert((output_offset & (this->addralign() - 1)) == 0);
this->set_data_size(output_offset);
this->unmergeable_cie_offsets_.begin();
p != this->unmergeable_cie_offsets_.end();
++p)
- o = p->first->write<size, big_endian>(oview, o, this->eh_frame_hdr_);
+ o = (*p)->write<size, big_endian>(oview, o, this->eh_frame_hdr_);
for (Cie_offsets::iterator p = this->cie_offsets_.begin();
p != this->cie_offsets_.end();
++p)
- o = p->first->write<size, big_endian>(oview, o, this->eh_frame_hdr_);
+ o = (*p)->write<size, big_endian>(oview, o, this->eh_frame_hdr_);
}
#ifdef HAVE_TARGET_32_LITTLE
#ifndef GOLD_EHFRAME_H
#define GOLD_EHFRAME_H
+#include <map>
+#include <set>
+#include <vector>
+
#include "output.h"
#include "merge.h"
{ return *cie1 < *cie2; }
};
- // A mapping from unique CIEs to their offset in the output file.
- typedef std::map<Cie*, uint64_t, Cie_less> Cie_offsets;
+ // A set of unique CIEs.
+ typedef std::set<Cie*, Cie_less> Cie_offsets;
- // A list of unmergeable CIEs with their offsets.
- typedef std::vector<std::pair<Cie*, uint64_t> > Unmergeable_cie_offsets;
+ // A list of unmergeable CIEs.
+ typedef std::vector<Cie*> Unmergeable_cie_offsets;
// A mapping from offsets to CIEs. This is used while reading an
// input section.