[PATCH 3/3] bfd: Improve lookup of file / line information for errors

Nick Clifton nickc@redhat.com
Thu Feb 16 10:22:00 GMT 2017


Hi Andrew,

> The line immediately before the loop:
> 
>     if ((section->flags & SEC_CODE) == 0)
> 
> means that 'objdump -dS' will not be slowed down, however, I see your
> point, 'objdump -DS' would be slowed down.

Good point.

> Caching the last match might help I guess, in the disassembly case
> where the offset is constantly changing we could resume searching from
> the last match, wrapping round at the end of the symbol list and
> stopping when we get back to our start point.  This would speed things
> up if we assume that symbols are usually sorted (sounds likely).

Let's apply the KISS principle here and not make the code more complex
than it needs to be at this point.

> My question then would be, do you agree that the incoming symbols are
> unsorted,

Yes.  Or at least we cannot rely upon them being sorted.

> and do you think I should create a sorted copy in the cached
> data, and so allow for a binary search?

Hmm tough call.  Given that this is for data sections, not code, I think
that the overhead would probably be too much.  So lets not do this now.
If later on we get a user report complaining about poor performance of 
this code (for a reasonable use case) then we can consider adding sorting.

So, just to be clear, your original 3/3 patch is now approved - please apply.

Cheers
  Nick



More information about the Binutils mailing list