Eh_frame_hdr::get_fde_pc(
typename elfcpp::Elf_types<size>::Elf_Addr eh_frame_address,
const unsigned char* eh_frame_contents,
- off_t fde_offset,
+ section_offset_type fde_offset,
unsigned char fde_encoding)
{
// The FDE starts with a 4 byte length and a 4 byte offset to the
// CIE. Record the FDE pc for EH_FRAME_HDR. Return the new offset.
template<int size, bool big_endian>
-off_t
-Fde::write(unsigned char* oview, off_t offset, off_t cie_offset,
- unsigned char fde_encoding, Eh_frame_hdr* eh_frame_hdr)
+section_offset_type
+Fde::write(unsigned char* oview, section_offset_type offset,
+ section_offset_type cie_offset, unsigned char fde_encoding,
+ Eh_frame_hdr* eh_frame_hdr)
{
size_t length = this->contents_.length();
// Set the output offset of a CIE. Return the new output offset.
-off_t
-Cie::set_output_offset(off_t output_offset, unsigned int addralign,
+section_offset_type
+Cie::set_output_offset(section_offset_type output_offset,
+ unsigned int addralign,
Merge_map* merge_map)
{
size_t length = this->contents_.length();
// recording. Return the new offset.
template<int size, bool big_endian>
-off_t
-Cie::write(unsigned char* oview, off_t offset, Eh_frame_hdr* eh_frame_hdr)
+section_offset_type
+Cie::write(unsigned char* oview, section_offset_type offset,
+ Eh_frame_hdr* eh_frame_hdr)
{
- off_t cie_offset = offset;
+ section_offset_type cie_offset = offset;
size_t length = this->contents_.length();
Eh_frame::add_ehframe_input_section(
Sized_relobj<size, big_endian>* object,
const unsigned char* symbols,
- off_t symbols_size,
+ section_size_type symbols_size,
const unsigned char* symbol_names,
- off_t symbol_names_size,
+ section_size_type symbol_names_size,
unsigned int shndx,
unsigned int reloc_shndx,
unsigned int reloc_type)
{
// Get the section contents.
- off_t contents_len;
+ section_size_type contents_len;
const unsigned char* pcontents = object->section_contents(shndx,
&contents_len,
false);
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;
Eh_frame::do_add_ehframe_input_section(
Sized_relobj<size, big_endian>* object,
const unsigned char* symbols,
- off_t symbols_size,
+ section_size_type symbols_size,
const unsigned char* symbol_names,
- off_t symbol_names_size,
+ section_size_type symbol_names_size,
unsigned int shndx,
unsigned int reloc_shndx,
unsigned int reloc_type,
const unsigned char* pcontents,
- off_t contents_len,
+ section_size_type contents_len,
New_cies* new_cies)
{
typedef typename elfcpp::Elf_types<size>::Elf_Addr Address;
Eh_frame::read_cie(Sized_relobj<size, big_endian>* object,
unsigned int shndx,
const unsigned char* symbols,
- off_t symbols_size,
+ section_size_type symbols_size,
const unsigned char* symbol_names,
- off_t symbol_names_size,
+ section_size_type symbol_names_size,
const unsigned char* pcontents,
const unsigned char* pcie,
const unsigned char *pcieend,
{
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.
Eh_frame::read_fde(Sized_relobj<size, big_endian>* object,
unsigned int shndx,
const unsigned char* symbols,
- off_t symbols_size,
+ section_size_type symbols_size,
const unsigned char* pcontents,
unsigned int offset,
const unsigned char* pfde,
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();
- off_t output_offset = 0;
+ 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);
bool
Eh_frame::do_output_offset(const Relobj* object, unsigned int shndx,
- off_t offset, off_t* poutput) const
+ section_offset_type offset,
+ section_offset_type* poutput) const
{
return this->merge_map_.get_output_offset(object, shndx, offset, poutput);
}
+// Return whether this is the merge section for an input section.
+
+bool
+Eh_frame::do_is_merge_section_for(const Relobj* object,
+ unsigned int shndx) const
+{
+ return this->merge_map_.is_merge_section_for(object, shndx);
+}
+
// Write the data to the output file.
void
void
Eh_frame::do_sized_write(unsigned char* oview)
{
- off_t o = 0;
+ section_offset_type o = 0;
for (Unmergeable_cie_offsets::iterator p =
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
Eh_frame::add_ehframe_input_section<32, false>(
Sized_relobj<32, false>* object,
const unsigned char* symbols,
- off_t symbols_size,
+ section_size_type symbols_size,
const unsigned char* symbol_names,
- off_t symbol_names_size,
+ section_size_type symbol_names_size,
unsigned int shndx,
unsigned int reloc_shndx,
unsigned int reloc_type);
Eh_frame::add_ehframe_input_section<32, true>(
Sized_relobj<32, true>* object,
const unsigned char* symbols,
- off_t symbols_size,
+ section_size_type symbols_size,
const unsigned char* symbol_names,
- off_t symbol_names_size,
+ section_size_type symbol_names_size,
unsigned int shndx,
unsigned int reloc_shndx,
unsigned int reloc_type);
Eh_frame::add_ehframe_input_section<64, false>(
Sized_relobj<64, false>* object,
const unsigned char* symbols,
- off_t symbols_size,
+ section_size_type symbols_size,
const unsigned char* symbol_names,
- off_t symbol_names_size,
+ section_size_type symbol_names_size,
unsigned int shndx,
unsigned int reloc_shndx,
unsigned int reloc_type);
Eh_frame::add_ehframe_input_section<64, true>(
Sized_relobj<64, true>* object,
const unsigned char* symbols,
- off_t symbols_size,
+ section_size_type symbols_size,
const unsigned char* symbol_names,
- off_t symbol_names_size,
+ section_size_type symbol_names_size,
unsigned int shndx,
unsigned int reloc_shndx,
unsigned int reloc_type);