diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-06-29 10:14:19 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-06-29 10:14:19 -0400 |
commit | 37ddf6e5fa1530adc3a7236379a3a88dfef33d53 (patch) | |
tree | ad7c05df8b0ebeafa75cfee1ed569bf2722091e2 /translate.cxx | |
parent | 53ca410a6a6032c2cde6aac6e95b57c68585e48a (diff) | |
download | systemtap-steved-37ddf6e5fa1530adc3a7236379a3a88dfef33d53.tar.gz systemtap-steved-37ddf6e5fa1530adc3a7236379a3a88dfef33d53.tar.xz systemtap-steved-37ddf6e5fa1530adc3a7236379a3a88dfef33d53.zip |
STP_RELOCATE message for kernel relocatability (re)adaption, starting implementation
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/translate.cxx b/translate.cxx index 433b82be..e5c91a3b 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4361,6 +4361,8 @@ dump_unwindsyms (Dwfl_Module *m, int syments = dwfl_module_getsymtab(m); assert(syments); + + c->output << "struct _stp_symbol _stp_kernel_symbols[] = {" << endl; for (int i = 1; i < syments; ++i) { GElf_Sym sym; @@ -4368,9 +4370,20 @@ dump_unwindsyms (Dwfl_Module *m, if (name) { if (GELF_ST_TYPE (sym.st_info) == STT_FUNC) - ; // addrmap[sym.st_value] = name; + { + if (sym.st_value < c->session.sym_stext) continue; + + c->output << " { 0x" << hex + << sym.st_value - c->session.sym_stext /* <<---- note _stext subtraction */ + << dec + << ", " << lex_cast_qstring (name) << " }," << endl; + } } } + c->output << "};" << endl; + c->output << "unsigned _stp_num_kernel_symbols = " + << "sizeof (_stp_kernel_symbols)/sizeof(struct _stp_symbol);" << endl; + return DWARF_CB_OK; } |