Created attachment 5935 [details] file to expose bug readelf 2.21.53 crashes with a division by zero when trying to display the debug aranges section of a (possibly malformed) file. To reproduce run readelf -wr hello.test.div For me this results in: Contents of the .debug_aranges section: Length: 28 Version: 2 Offset into .debug_info: 0x0 Pointer Size: 0 Segment Size: 0 Address Length Floating point exception
(In reply to comment #0) > Created attachment 5935 [details] > file to expose bug > > readelf 2.21.53 crashes with a division by zero when trying to display the > debug aranges section of a (possibly malformed) file. > > To reproduce run > > readelf -wr hello.test.div > > For me this results in: > Contents of the .debug_aranges section: > > Length: 28 > Version: 2 > Offset into .debug_info: 0x0 > Pointer Size: 0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Bad input file.
Yes, I would have expected a 'Bad input file' message rather than a FP exception
CVSROOT: /cvs/src Module name: src Changes by: hjl@sourceware.org 2011-09-18 16:50:17 Modified files: binutils : ChangeLog dwarf.c Log message: Check zero address size. 2011-09-18 H.J. Lu <hongjiu.lu@intel.com> PR binutils/13196 * dwarf.c (display_debug_aranges): Check zero address size. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/ChangeLog.diff?cvsroot=src&r1=1.1827&r2=1.1828 http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/dwarf.c.diff?cvsroot=src&r1=1.99&r2=1.100
Fixed.