This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] binutils: Improve symbols lookup


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]