]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: vdsosyms call dwfl_linux_proc_attach.
authorMark Wielaard <mjw@redhat.com>
Thu, 27 Nov 2014 22:19:47 +0000 (23:19 +0100)
committerMark Wielaard <mjw@redhat.com>
Wed, 3 Dec 2014 12:44:30 +0000 (13:44 +0100)
Older kernels won't let us get at the vdso otherwise.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
tests/ChangeLog
tests/vdsosyms.c

index 909a61e1704aa855cdfb806b18de95e4e0834eb7..87a453db83b9209e48bb8d8afc913fa14608a6d7 100644 (file)
@@ -1,3 +1,7 @@
+2014-11-27  Mark Wielaard  <mjw@redhat.com>
+
+       * vdsosyms.c (main): Call dwfl_linux_proc_attach.
+
 2014-11-21  Mark Wielaard  <mjw@redhat.com>
 
        * run-readelf-A.sh: New test.
index 831caf427cd249783c975625cb1e1d03e915de9b..d04f36a1047f3adba735254fc9dcd331502fa4b4 100644 (file)
@@ -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));