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] Fix readelf display of 8-byte values


Hi Cary,

In binutils/dwarf.c, read_and_display_attr_value(), the handling of
ref8 and data8 forms uses dwarf_vmatoa for the first 4 bytes, but uses
printf to format the second 4 bytes:

Is this an oversight, or intentional?

I think that this is an oversight.


A patch for what I've suggested is attached. Comments?

I like the patch apart from two small issues:


* The new function dwarf_vmatoa64() returns a pointer to a statically scoped buffer. This is a dangerous practice and will lead to problems if it is invoked more than once within a given statement. It would be better to fill in a buffer provided to the function, or to have multiple buffers (ala dwarf_vmatoa), or at least to have a warning comment at the start of the function.

* Since byte_get_high() and byte_get_low() are always called as a pair, and in sequence, why not just replace them with a single function, (eg byte_get64) which fills in both values ?

Cheers
  Nick


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