aboutsummaryrefslogtreecommitdiff
path: root/gold/reloc.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-11-15 23:46:46 +0000
committerIan Lance Taylor <iant@google.com>2007-11-15 23:46:46 +0000
commit4f4c5f80c7482fbd1c2fd5a3b96547f5099bf3fd (patch)
treed4dbb773a8511bc57cfe9b5462fa44e3c2c2b19e /gold/reloc.cc
parent02d2ba740273e3f539501337eebf0c6007af0b4b (diff)
downloadfsf-binutils-gdb-4f4c5f80c7482fbd1c2fd5a3b96547f5099bf3fd.zip
fsf-binutils-gdb-4f4c5f80c7482fbd1c2fd5a3b96547f5099bf3fd.tar.gz
fsf-binutils-gdb-4f4c5f80c7482fbd1c2fd5a3b96547f5099bf3fd.tar.bz2
From Cary Coutant: Count textrel with output sections rather than
setting a flag as we add each reloc in the target code.
Diffstat (limited to 'gold/reloc.cc')
-rw-r--r--gold/reloc.cc15
1 files changed, 10 insertions, 5 deletions
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<size, big_endian>::Copy_reloc_entry::emit(
Output_data_reloc<elfcpp::SHT_REL, true, size, big_endian>* 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<size, big_endian>::Copy_reloc_entry::emit(
Output_data_reloc<elfcpp::SHT_RELA, true, size, big_endian>* 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<size, big_endian>::save(
Symbol* sym,
Relobj* relobj,
unsigned int shndx,
+ Output_section* output_section,
const elfcpp::Rel<size, big_endian>& rel)
{
unsigned int reloc_type = elfcpp::elf_r_type<size>(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<size, big_endian>::save(
Symbol* sym,
Relobj* relobj,
unsigned int shndx,
+ Output_section* output_section,
const elfcpp::Rela<size, big_endian>& rela)
{
unsigned int reloc_type = elfcpp::elf_r_type<size>(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()));
}