[patch x64 bfd]: Rework dump of pdata/xdata for x64
Richard Henderson
rth@redhat.com
Wed Sep 15 17:05:00 GMT 2010
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~
More information about the Binutils
mailing list