DWARF header checks
This patch tidies DWARF header checks, consolidating the "negative"
checks (which are really overflow checks) with the section size
check. In a number of cases this also ensures that small negative
lengths are caught. For instance
hdrptr = start + arange.ar_length + initial_length_size;
if (hdrptr < start || hdrptr > end)
does not detect ar_length in the range [-initial_length_size,-1].
* dwarf.c (process_debug_info): Consolidate header length checks.
(display_debug_pubnames_worker): Use "start" to read header.
Properly check header length and report errors earlier.
Simplify loop printing pubnames.
(get_line_filename_and_dirname): Catch small negative "length"
values.
(display_debug_aranges): Likewise. Report header errors
earlier using standardized message.
(display_debug_names): Likewise.