[PATCH] readelf: Fix cie_offset calculation comparison on 32bit.

Mark Wielaard mjw at redhat.com
Tue Apr 28 12:15:08 UTC 2015


On Wed, 2015-04-22 at 12:50 +0200, Mark Wielaard wrote:
> gcc -fsanitize=undefined pointed out that on 32bit systems the calculation
> to match the cie_offset to the cie_id could be undefined because a cie_id
> could be an unsigned 64bit value while ptrdiff_t is only 32bits. Correct
> the calculation to use 64bit values.
>
>  2015-03-22  Mark Wielaard  <mjw at redhat.com>
>  
> +	* readelf.c (print_debug_frame_section): Cast start to Dwarf_Off
> +	before subtracting cie_id.

That wasn't completely correct on 64bit. We also need to explicitly cast
cie_offset to Dwarf_Off. Pushed with that fixed as attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-readelf-Fix-cie_offset-calculation-comparison-on-32b.patch
Type: text/x-patch
Size: 1707 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/elfutils-devel/attachments/20150428/c1c4dfb9/attachment.bin>


More information about the elfutils-devel mailing list