summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2018-05-20 21:57:39 +0200
committerMark Wielaard <[email protected]>2018-05-30 14:56:28 +0200
commite9e64f6748499d458b951e0dcd46d6cc9d850886 (patch)
treec2b0538445c6eae69f1b2de46463415feb4f9d06 /src
parent4ac4a42376428248f7174c7bb713fff27bb4d4b0 (diff)
libdw: Fix memory corruption in libdw_find_split_unit.
Found by valgrind when trying to match a split unit from a .dwo file that doesn't contain the split unit (as first) match. We would close the split Dwarf too early, before we had inspected all units in it. Add a testcase that simulates this. Which failed (at least under valgrind as run by make distcheck) before the fix. Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/readelf.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 545fb503..b6f66bdd 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-28 Mark Wielaard <[email protected]>
+
+ * readelf.c (print_debug_units): Turn "Could not find split compile
+ unit" into an Warning instead of an error.
+
2018-04-29 Mark Wielaard <[email protected]>
* readelf.c (parse_opt): Request implicit section_info for "str".
diff --git a/src/readelf.c b/src/readelf.c
index be9fe88c..bfa1d16d 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -7668,7 +7668,7 @@ print_debug_units (Dwfl_Module *dwflmod,
|| dwarf_tag (&subdie) == DW_TAG_invalid)
{
if (!silent)
- error (0, 0, gettext ("Could not find split compile unit"));
+ fprintf (stderr, gettext ("Could not find split compile unit"));
}
else
{