[PATCH] binutils: Improve symbols lookup
Alan Modra
amodra@gmail.com
Thu Dec 12 05:37:00 GMT 2019
On Wed, Dec 11, 2019 at 05:06:13PM +0100, Borislav Petkov wrote:
> --- a/binutils/objdump.c
> +++ b/binutils/objdump.c
> @@ -1129,6 +1129,13 @@ find_symbol_for_address (bfd_vma vma,
> *place = thisplace;
>
> return sorted_syms[thisplace];
> + } else if (sym_ok (FALSE, abfd, min, sec, inf)) {
> +
> + /* Couldn't find a symbol in the current section, try any
> + section but prefer OBJECT or FUNC types to NOTYPE symbols. */
> + if (!(sorted_syms[thisplace]->flags & (BSF_OBJECT | BSF_FUNCTION))
> + && (sorted_syms[min]->flags & (BSF_OBJECT | BSF_FUNCTION)))
> + thisplace = min;
> }
> ++min;
> }
The right way to prefer function and object symbols is to modify
compare_symbols.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list