DWARF header checks
authorAlan Modra <amodra@gmail.com>
Fri, 6 Oct 2017 03:44:21 +0000 (14:14 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 6 Oct 2017 05:43:08 +0000 (16:13 +1030)
commite98fdf1ab07243fe467caadd0d033b44b8ca20c7
treea40ab6ad74dbc14a505320c59e66182e5612d513
parent0caf6c82ab23ece570d14499ed02653968cd8abd
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.
binutils/ChangeLog
binutils/dwarf.c
This page took 0.025441 seconds and 4 git commands to generate.