readelf: endless loop on attrv2

Given a short attributes section, elf_parse_attrs_subsection_v2 prints
an error message but does not return an error status or consume any
input.  That results in endless printing of "Object attributes section
ends prematurely".  The length checks also ignored a single excess
byte at the end of the section.

	* readelf.c (elf_parse_attrs_subsection_v2): Move various
	constants out of function.  Don't check for min length here..
	(process_attributes_v2): ..do so here instead.
1 file changed