This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

function symbols before module base address


Hi,

I was seeing some failures on i386 2.6.18 kernels with systemtap and
elfutils 0.140. The issue was that there are a couple of symbols before
the kernel module base address, in particular __kernel_vsyscall,
__kernel_sigreturn and __kernel_rt_sigreturn, which seem to be vdso
functions and not really inside the kernel itself. This messes up our
logic since we do call dwfl_module_relocate_address on them (which
actually works with 0.140, which is why we are seeing this now, since
0.137 would just return them as is), which turns them into very large
positive 64 bit addresses messing up out stap-symbols.h file (causing it
to not compile).

I worked around this as follows:

2009-02-19  Mark Wielaard  <mjw@redhat.com>

    * translate.cxx (dump_unwindsyms): Ignore symbols before module
    base address.

Tested on a couple of elfutils 0.137/0.140 i386/x86_64 2.6.18/2.6.27
kernels. And it seems to do what I expect it to do. But please do yell
and scream if I misinterpreted something.

Cheers,

Mark

diff --git a/translate.cxx b/translate.cxx
index 31f2043..e87e987 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -4544,6 +4544,12 @@ dump_unwindsyms (Dwfl_Module *m,
               Dwarf_Addr sym_addr = sym.st_value;
               const char *secname = NULL;
 
+              // Symbol addresses before the base address of the module
+              // are suspect. Older kernels had those for some vsdo
+              // symbols. They mess up our logic, ignore them.
+              if (sym_addr < base)
+                continue;
+
               if (n > 0) // only try to relocate if there exist relocation base
                 {
                   int ki = dwfl_module_relocate_address (m, &sym_addr);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]