This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [GOLD][PATCH] Arm_input_section class.
- From: Ian Lance Taylor <iant at google dot com>
- To: Doug Kwan (éæå) <dougkwan at google dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Wed, 21 Oct 2009 17:48:23 -0700
- Subject: Re: [GOLD][PATCH] Arm_input_section class.
- References: <498552560910211438x56101569ube93fbed135defc1@mail.gmail.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.
> + // If this onws a stub table and it is not empty, write it.
s/onws/owns/
This is OK with that change.
Thanks.
Ian