diff options
author | Ian Lance Taylor <iant@google.com> | 2007-11-15 23:46:46 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-11-15 23:46:46 +0000 |
commit | 4f4c5f80c7482fbd1c2fd5a3b96547f5099bf3fd (patch) | |
tree | d4dbb773a8511bc57cfe9b5462fa44e3c2c2b19e /gold/output.cc | |
parent | 02d2ba740273e3f539501337eebf0c6007af0b4b (diff) | |
download | binutils-4f4c5f80c7482fbd1c2fd5a3b96547f5099bf3fd.zip binutils-4f4c5f80c7482fbd1c2fd5a3b96547f5099bf3fd.tar.gz binutils-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/output.cc')
-rw-r--r-- | gold/output.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gold/output.cc b/gold/output.cc index ef5c509..5832ded 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -1580,6 +1580,28 @@ Output_segment::maximum_alignment(const Output_data_list* pdl) return ret; } +// Return the number of dynamic relocs applied to this segment. + +unsigned int +Output_segment::dynamic_reloc_count() const +{ + return (this->dynamic_reloc_count_list(&this->output_data_) + + this->dynamic_reloc_count_list(&this->output_bss_)); +} + +// Return the number of dynamic relocs applied to an Output_data_list. + +unsigned int +Output_segment::dynamic_reloc_count_list(const Output_data_list* pdl) const +{ + unsigned int count = 0; + for (Output_data_list::const_iterator p = pdl->begin(); + p != pdl->end(); + ++p) + count += (*p)->dynamic_reloc_count(); + return count; +} + // Set the section addresses for an Output_segment. ADDR is the // address and *POFF is the file offset. Set the section indexes // starting with *PSHNDX. Return the address of the immediately |