This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] binutils: Improve symbols lookup
- From: Alan Modra <amodra at gmail dot com>
- To: Borislav Petkov <bp at suse dot de>
- Cc: binutils at sourceware dot org, Michael Matz <matz at suse dot de>
- Date: Thu, 12 Dec 2019 16:07:35 +1030
- Subject: Re: [PATCH] binutils: Improve symbols lookup
- References: <20191211160613.28935-1-bp@suse.de>
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