public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Doug Kwan (關振德)" <dougkwan@google.com>
To: Ian Lance Taylor <iant@google.com>
Cc: binutils <binutils@sourceware.org>
Subject: Re: [GOLD][PATCH] Arm_input_section class.
Date: Thu, 22 Oct 2009 01:17:00 -0000	[thread overview]
Message-ID: <498552560910211817o3add5c2eg472eaff32661ffa3@mail.gmail.com> (raw)
In-Reply-To: <mcroco045k8.fsf@dhcp-172-17-9-151.mtv.corp.google.com>

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
>

      reply	other threads:[~2009-10-22  1:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-21 21:39 Doug Kwan (關振德)
2009-10-22  0:48 ` Ian Lance Taylor
2009-10-22  1:17   ` Doug Kwan (關振德) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=498552560910211817o3add5c2eg472eaff32661ffa3@mail.gmail.com \
    --to=dougkwan@google.com \
    --cc=binutils@sourceware.org \
    --cc=iant@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).