From 4f4c5f80c7482fbd1c2fd5a3b96547f5099bf3fd Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 15 Nov 2007 23:46:46 +0000 Subject: From Cary Coutant: Count textrel with output sections rather than setting a flag as we add each reloc in the target code. --- gold/reloc.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'gold/reloc.cc') diff --git a/gold/reloc.cc b/gold/reloc.cc index 7a95dee..ab74498 100644 --- a/gold/reloc.cc +++ b/gold/reloc.cc @@ -556,8 +556,8 @@ Copy_relocs::Copy_reloc_entry::emit( Output_data_reloc* reloc_data) { this->sym_->set_needs_dynsym_entry(); - reloc_data->add_global(this->sym_, this->reloc_type_, this->relobj_, - this->shndx_, this->address_); + reloc_data->add_global(this->sym_, this->reloc_type_, this->output_section_, + this->relobj_, this->shndx_, this->address_); } // Emit a reloc into a SHT_RELA section. @@ -568,8 +568,9 @@ Copy_relocs::Copy_reloc_entry::emit( Output_data_reloc* reloc_data) { this->sym_->set_needs_dynsym_entry(); - reloc_data->add_global(this->sym_, this->reloc_type_, this->relobj_, - this->shndx_, this->address_, this->addend_); + reloc_data->add_global(this->sym_, this->reloc_type_, this->output_section_, + this->relobj_, this->shndx_, this->address_, + this->addend_); } // Copy_relocs methods. @@ -606,11 +607,13 @@ Copy_relocs::save( Symbol* sym, Relobj* relobj, unsigned int shndx, + Output_section* output_section, const elfcpp::Rel& rel) { unsigned int reloc_type = elfcpp::elf_r_type(rel.get_r_info()); this->entries_.push_back(Copy_reloc_entry(sym, reloc_type, relobj, shndx, - rel.get_r_offset(), 0)); + output_section, + rel.get_r_offset(), 0)); } // Save a Rela reloc. @@ -621,10 +624,12 @@ Copy_relocs::save( Symbol* sym, Relobj* relobj, unsigned int shndx, + Output_section* output_section, const elfcpp::Rela& rela) { unsigned int reloc_type = elfcpp::elf_r_type(rela.get_r_info()); this->entries_.push_back(Copy_reloc_entry(sym, reloc_type, relobj, shndx, + output_section, rela.get_r_offset(), rela.get_r_addend())); } -- cgit v1.1