From: Mark Wielaard Date: Thu, 27 Nov 2014 22:19:47 +0000 (+0100) Subject: tests: vdsosyms call dwfl_linux_proc_attach. X-Git-Tag: elfutils-0.161~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=44662163432677ce2c6c1888ad42c72fb2ebdb63;p=thirdparty%2Felfutils.git tests: vdsosyms call dwfl_linux_proc_attach. Older kernels won't let us get at the vdso otherwise. Signed-off-by: Mark Wielaard --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 909a61e17..87a453db8 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2014-11-27 Mark Wielaard + + * vdsosyms.c (main): Call dwfl_linux_proc_attach. + 2014-11-21 Mark Wielaard * run-readelf-A.sh: New test. diff --git a/tests/vdsosyms.c b/tests/vdsosyms.c index 831caf427..d04f36a10 100644 --- a/tests/vdsosyms.c +++ b/tests/vdsosyms.c @@ -89,6 +89,13 @@ main (int argc __attribute__ ((unused)), char **argv __attribute__ ((unused))) else if (result > 0) error (2, result, "dwfl_linux_proc_report"); + /* Also explicitly attach for older kernels (cannot read vdso otherwise). */ + result = dwfl_linux_proc_attach (dwfl, pid, false); + if (result < 0) + error (2, 0, "dwfl_linux_proc_attach: %s", dwfl_errmsg (-1)); + else if (result > 0) + error (2, result, "dwfl_linux_proc_attach"); + if (dwfl_report_end (dwfl, NULL, NULL) != 0) error (2, 0, "dwfl_report_end: %s", dwfl_errmsg (-1));