diff options
author | Doug Kwan <dougkwan@google.com> | 2010-04-13 20:37:55 +0000 |
---|---|---|
committer | Doug Kwan <dougkwan@google.com> | 2010-04-13 20:37:55 +0000 |
commit | 153e7da4fc01a28171a44f5538a80e8cc29e1818 (patch) | |
tree | 2e4bcf0784bb10c9ce4d2d0f96ac4357721be9f2 /gold | |
parent | cb1cc9c67ab42392913b61d630a3f72369e1c9ac (diff) | |
download | gdb-153e7da4fc01a28171a44f5538a80e8cc29e1818.zip gdb-153e7da4fc01a28171a44f5538a80e8cc29e1818.tar.gz gdb-153e7da4fc01a28171a44f5538a80e8cc29e1818.tar.bz2 |
2010-04-13 Doug Kwan <dougkwan@google.com>
* arm.cc (Arm_input_section::set_final_data_size): Compute
accurate final data size instead of using current data size.
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 5 | ||||
-rw-r--r-- | gold/arm.cc | 18 |
2 files changed, 12 insertions, 11 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index 123cbb9..0fd5fde 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2010-04-13 Doug Kwan <dougkwan@google.com> + + * arm.cc (Arm_input_section::set_final_data_size): Compute + accurate final data size instead of using current data size. + 2010-04-09 Doug Kwan <dougkwan@google.com> * layout.cc (Layout::choose_output_section): Handle script section diff --git a/gold/arm.cc b/gold/arm.cc index c9e730b..036160f 100644 --- a/gold/arm.cc +++ b/gold/arm.cc @@ -4935,21 +4935,17 @@ template<bool big_endian> void Arm_input_section<big_endian>::set_final_data_size() { - // If this owns a stub table, finalize its data size as well. + off_t off = convert_types<off_t, uint64_t>(this->original_size_); + if (this->is_stub_table_owner()) { - uint64_t address = this->address(); - // The stub table comes after the original section contents. - address += this->original_size_; - address = align_address(address, this->stub_table_->addralign()); - off_t offset = this->offset() + (address - this->address()); - this->stub_table_->set_address_and_file_offset(address, offset); - address += this->stub_table_->data_size(); - gold_assert(address == this->address() + this->current_data_size()); + off = align_address(off, this->stub_table_->addralign()); + this->stub_table_->set_address_and_file_offset(this->address() + off, + this->offset() + off); + off += this->stub_table_->data_size(); } - - this->set_data_size(this->current_data_size()); + this->set_data_size(off); } // Reset address and file offset. |