[Patch] Quit truncating dynamic tag values in readelf.
David Daney
david.daney@cavium.com
Tue Dec 6 19:33:00 GMT 2011
In readelf, the printing of of DT_MIPS_* dynamic tag values was being
done with the printf 'l' format specifier. Since the values are 64 bits
wide, this resulted in the truncation and printing of only the lower 32
bits on hosts with 32-bit long.
readelf has already defined print_vma() and BFD_VMA_FMT just for
printing these values, so use these instead in
dynamic_section_mips_val(). Since print_vma() does not print the
trailing '\n' we need to emit this with a separate putchar('\n') call.
The code becomes cleaner if we use this putchar() for all the cases, so
we also remove the '\n' from the other strings in the function.
Tested on mips64-linux-gnu and x86_64-linux-gnu with no regressions.
OK to commit?
2011-12-06 David Daney <david.daney@cavium.com>
* readelf.c (dynamic_section_mips_val): Factor out trailing '\n'
from printed strings and move it to the end of the function.
Use BFD_VMA_FMT for printf format specifier for dynamic tag value.
Use print_vma() to print dynamic tag values.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: readelf.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20111206/7b8ab789/attachment.ksh>
More information about the Binutils
mailing list