[GOLD][PATCH] Arm_input_section class.

Doug Kwan (關振德) dougkwan@google.com
Thu Oct 22 01:17:00 GMT 2009


Hi Ian,

2009/10/21 Ian Lance Taylor <iant@google.com>:
> "Doug Kwan (關振德)" <dougkwan@google.com> writes:
>
>> +// Initialize an Arm_input_section.
>> +
>> +template<bool big_endian>
>> +void
>> +Arm_input_section<big_endian>::init()
>> +{
>> +  Relobj* relobj = this->relobj();
>> +  unsigned int shndx = this->shndx();
>> +
>> +  // Cache these to speed up size and alignment queries.  It is too slow
>> +  // to call section_addraglin and section_size every time.
>> +  this->original_addralign_ = relobj->section_addralign(shndx);
>> +  this->original_size_ = relobj->section_size(shndx);
>> +
>> +  // We want to make this look like the original input section after
>> +  // output sections are finalized.
>> +  Output_section* os = relobj->output_section(shndx);
>> +  off_t offset = relobj->output_section_offset(shndx);
>> +  gold_assert(os != NULL && !relobj->is_output_section_offset_invalid(shndx));
>> +  this->set_address(os->address() + offset);
>> +  this->set_file_offset(os->offset() + offset);
>> +
>> +  this->set_current_data_size(this->original_size_);
>> +  this->finalize_data_size();
>> +}
>
> When are these objects going to be initialized?  Will the section
> header be available?  If so, that would be better than calling
> section_addralign and section_size.

The Arm_input_section is used in relaxation, by which time the section
header is availbble.  I can can change that tot use the section
headers.

-Doug

>
>> +  // If this onws a stub table and it is not empty, write it.
>
> s/onws/owns/
>

Okay.

> This is OK with that change.
>
> Thanks.
>
> Ian
>



More information about the Binutils mailing list