This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH] readelf: Show set_loc argument as hexadecimal
- From: Roland McGrath <roland at hack dot frob dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 20 Jan 2016 15:14:16 -0800
- Subject: Re: [PATCH] readelf: Show set_loc argument as hexadecimal
> Other addresses in this code are printed with ("%#" PRIx64).
> (AFAIK '#' here will always give "0x", but lets keep it consistent).
%#x prints "0" for zero (not "0x0"). Indeed it is the right thing to use here.
> It's also curious that nothing is done with op1 after printing it.
> Shouldn't this set pc, at least?
I think it should, but that is unrelated to this change.
Arguably, it should be:
get_uleb128 (op1, readp, endp);
op1 *= code_align;
printf (" set_loc %#" PRIx64 " to %#" PRIx64 "\n",
op1, pc = vma_base + op1);
so that it displays the literal value (like the other cases do) as well as
the final value (which in this case is just with VMA_BASE added in).