summaryrefslogtreecommitdiff
path: root/libdw
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2013-03-25 17:07:21 +0100
committerMark Wielaard <mjw@redhat.com>2013-03-26 10:07:32 +0100
commit60ef9ab76eecfa175bc0bea4ab6005a947987781 (patch)
tree8c4f0e53a8f8ba83c002bed2b94180e4de43614f /libdw
parenta8c7f05cfd03a58821c3da68f3f577c882258674 (diff)
downloadelfutils-60ef9ab76eecfa175bc0bea4ab6005a947987781.tar.gz
libdw: dwarf_getsrclines mark highest address as end_sequence.
Make sure the highest address for the CU is marked as end_sequence. This is required by the DWARF spec, but some compilers forget and dwfl_module_getsrc depends on it. We could reject it as bad DWARF but the DWARF .debug_lines spec is much stricter than what compilers seem to output in practice. Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'libdw')
-rw-r--r--libdw/ChangeLog5
-rw-r--r--libdw/dwarf_getsrclines.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 16acf5cd..12df9bbe 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-25 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf_getsrclines.c (dwarf_getsrclines): Mark highest address as
+ end_sequence.
+
2013-03-12 Mark Wielaard <mjw@redhat.com>
* dwarf_getsrcfiles.c (dwarf_getsrcfiles): Allow DW_TAG_partial_unit.
diff --git a/libdw/dwarf_getsrclines.c b/libdw/dwarf_getsrclines.c
index c24aebb5..5a58b783 100644
--- a/libdw/dwarf_getsrclines.c
+++ b/libdw/dwarf_getsrclines.c
@@ -712,6 +712,11 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines)
cu->lines->info[i].files = files;
}
+ /* Make sure the highest address for the CU is marked as end_sequence.
+ This is required by the DWARF spec, but some compilers forget and
+ dwfl_module_getsrc depends on it. */
+ cu->lines->info[nlinelist - 1].end_sequence = 1;
+
/* Success. */
res = 0;
}