[GOLD][PATCH] Arm_input_section class.
Ian Lance Taylor
iant@google.com
Thu Oct 22 00:48:00 GMT 2009
"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.
> + // If this onws a stub table and it is not empty, write it.
s/onws/owns/
This is OK with that change.
Thanks.
Ian
More information about the Binutils
mailing list