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: RFC: Adding visualization of jumps to objdump's disassembly output


>>>>> "Nick" == Nick Clifton <nickc@redhat.com> writes:

Nick>   I am posting the patch here as I would very much like to see it added
Nick>   before the 2.34 branch is cut, but I wanted more pairs of eyes than
Nick>   just mine to have a look over it.  So - does anyone have any concerns
Nick>   or issues with the patch ?

Is there any way to put this into libopcodes or BFD, rather than binutils?
I think it would make a nice addition to gdb's "disassemble" command.

Nick> +#if 1
Nick> +/* Very simple hash function to map any address to an 8 bit value.  The main
Nick> +   purpose of this is to generate all colors in the case the input addresses
Nick> +   are all even or divisible by 4 or 8 or follow some other pattern. */
Nick> +
Nick> +static uint8_t
Nick> +hash_address (bfd_vma address)
Nick> +{
Nick> +  bfd_vma result = address;
Nick> +
Nick> +  result += result << 5;
Nick> +  result ^= result >> 7;
Nick> +
Nick> +  return result % 256;
Nick> +}
Nick> +#else
Nick> +/* This code was taken from:
Nick> +    https://en.wikipedia.org/wiki/Jenkins_hash_function
Nick> +   TODO: Does this work with the GPL?  */

I think this should be resolved before checking it in.  If it's just a
generic hash function you need, there's one in hashtab.c though.

thanks,
Tom


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