It can happen that there are no line number statements at the end of
a debug line section. So don't check that there are any more bytes
after the last file entry. And print "No line number statements."
libdw already got this corner case correct.
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2020-08-26 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug_line_section): It is not an error if there
+ are no line number statements at the end of a debug line section.
+
2020-07-19 Mark Wielaard <mark@klomp.org>
* elfclassify.c (process_current_path): Handle fwrite failing.
printf (", ");
}
printf ("\n");
- if (linep >= lineendp)
+ if (linep > lineendp)
goto invalid_unit;
}
}
++linep;
}
+ if (linep == lineendp)
+ {
+ puts (gettext ("\nNo line number statements."));
+ return;
+ }
+
puts (gettext ("\nLine number statements:"));
Dwarf_Word address = 0;
unsigned int op_index = 0;