[PATCH] Fix return code in _bfd_dwarf2_find_nearest_line().

Nick Clifton nickc@redhat.com
Wed Mar 23 12:10:00 GMT 2022


Hi Steinar,

>> You probably could make a persistent structure.  It is unlikely that the

> But how could it be detected? Even if the pointer being sent in is the
> same, the contents of the array could be different, and we'd need to
> scan through all of it, defeating the purpose?

The combination of the 'abfd' pointer and the 'symbols' is probably unique.
But you are right - this cannot be guaranteed.

So the proper way to solve this problem is to create a new function, or
rather group of functions.  One to register a symbol table and then another
the perform scans using that symbol table.  And another function to free
any stored data, of course.

Then callers can choose which API to use.  Fortunately (or maybe
unfortunately) the BFD library has a history of having an unstable API,
so you do not have to worry about versioning.

Cheers
   Nick



More information about the Binutils mailing list