This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch x64 bfd]: Rework dump of pdata/xdata for x64


On 09/15/2010 08:17 AM, Kai Tietz wrote:
> +	  fprintf (file, "  has %s begin address as antecessor\n",

predecessor

> +	  fprintf (file, "  has negate begin address\n");

negative

> +static bfd_vma
> +find_next_xdata_or_end (bfd *abfd, bfd_byte *pdata, bfd_size_type stop,
> +			int onaline, bfd_vma cur_address, bfd_vma max_size)

I do wonder if a linear search is the right thing here.

What about something like

  N = number of pdata entries;
  A = new rva[N + 1];

  for (i = 0; i < N; i++)
    A[i] = pdata[i].xdata_rva;
  A[N] = xdata_end;

  sort(A);

  rva find_next_xdata(rva user_data)
  {
    Binary search for user_data in A.
    If there is an exact match, the user_data
    section is empty.  Otherwise, the end of
    the user_data is the next highest value.
  }

I'm ok with this being done as a follow-on patch.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]