diff -Naur oprofile-0.9.5.orig/daemon/liblegacy/opd_kernel.c oprofile-0.9.5/daemon/liblegacy/opd_kernel.c
--- oprofile-0.9.5.orig/daemon/liblegacy/opd_kernel.c	2009-08-17 21:08:08.000000000 -0400
+++ oprofile-0.9.5/daemon/liblegacy/opd_kernel.c	2009-08-17 21:09:05.000000000 -0400
@@ -349,6 +349,14 @@
  * If the sample could not be located in a module, it is treated
  * as a kernel sample.
  */
+ 
+#ifndef query_module
+int query_module(char const * name, int which, void *buf, size_t bufsize,
+     size_t *ret) {
+  return 0;
+}
+#endif
+
 static void opd_handle_module_sample(unsigned long eip, u32 counter)
 {
 	struct opd_module * module;
