diff options
author | Ian Lance Taylor <iant@google.com> | 2007-12-20 16:27:34 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-12-20 16:27:34 +0000 |
commit | 1e9836570f11422834da6ad9ccc49ce2fd121222 (patch) | |
tree | c82b87b27858bcc53e34c1a804def361e269b678 /gold/output.cc | |
parent | 63c2c2877bddc79a54ef833cf7b42f95a5f94ff6 (diff) | |
download | binutils-1e9836570f11422834da6ad9ccc49ce2fd121222.zip binutils-1e9836570f11422834da6ad9ccc49ce2fd121222.tar.gz binutils-1e9836570f11422834da6ad9ccc49ce2fd121222.tar.bz2 |
Update comments about output offsets and merged input sections.
Diffstat (limited to 'gold/output.cc')
-rw-r--r-- | gold/output.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gold/output.cc b/gold/output.cc index fa2bff0..793d6a3 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -1347,7 +1347,9 @@ Output_section::Input_section::finalize_data_size() this->u2_.posd->finalize_data_size(); } -// Try to turn an input offset into an output offset. +// Try to turn an input offset into an output offset. We want to +// return the output offset relative to the start of this +// Input_section in the output section. inline bool Output_section::Input_section::output_offset( @@ -1362,11 +1364,7 @@ Output_section::Input_section::output_offset( { if (this->shndx_ != shndx || this->u2_.object != object) return false; - section_offset_type output_offset; - Output_section* os = object->output_section(shndx, &output_offset); - gold_assert(os != NULL); - gold_assert(output_offset != -1); - *poutput = output_offset + offset; + *poutput = offset; return true; } } @@ -1655,8 +1653,8 @@ Output_section::is_input_address_mapped(const Relobj* object, // Given an address OFFSET relative to the start of input section // SHNDX in object OBJECT, return the output offset relative to the -// start of the section. This should only be called if SHNDX in -// OBJECT has a special mapping. +// start of the input section in the output section. This should only +// be called if SHNDX in OBJECT has a special mapping. section_offset_type Output_section::output_offset(const Relobj* object, unsigned int shndx, |