diff options
author | Wenji Huang <wenji.huang@oracle.com> | 2008-10-06 03:07:09 -0400 |
---|---|---|
committer | Wenji Huang <wenji.huang@oracle.com> | 2008-10-06 03:07:09 -0400 |
commit | 2949597251fea7f17a0e46c1c885e34b53395d18 (patch) | |
tree | 7628da32ea81a5bbaf10f31c7fd60006629db3d6 /runtime/transport/symbols.c | |
parent | 5311c037f83f66967f9de4cc66815f93940bb005 (diff) | |
download | systemtap-steved-2949597251fea7f17a0e46c1c885e34b53395d18.tar.gz systemtap-steved-2949597251fea7f17a0e46c1c885e34b53395d18.tar.xz systemtap-steved-2949597251fea7f17a0e46c1c885e34b53395d18.zip |
PR4886: check build-id if able.
This provides sanity check of debuginfo file based on build-id. Many cases are considered, whether build-id exists in debuginfo file or not, whether module is loaded or not, whether build-id exists in runtime kernel/module. It will do work when LD >= 2.18 and kernel >=2.6.23, otherwise no check.
Diffstat (limited to 'runtime/transport/symbols.c')
-rw-r--r-- | runtime/transport/symbols.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c index 4bdd0904..faba0986 100644 --- a/runtime/transport/symbols.c +++ b/runtime/transport/symbols.c @@ -51,8 +51,16 @@ static void _stp_do_relocation(const char __user *buf, size_t count) if (strcmp (_stp_modules[mi]->name, msg.module)) continue; + /* update note section to represent loaded */ + if (_stp_modules[mi]->notes_sect == 0) + _stp_modules[mi]->notes_sect = 1; for (si=0; si<_stp_modules[mi]->num_sections; si++) { + if (!strcmp (".note.gnu.build-id", msg.reloc)) { + _stp_modules[mi]->notes_sect = msg.address; + continue; + } + if (strcmp (_stp_modules[mi]->sections[si].name, msg.reloc)) continue; @@ -134,7 +142,8 @@ static int _stp_section_is_interesting(const char *name) { int ret = 1; if (!strncmp("__", name, 2) - || !strncmp(".note", name, 5) + || (!strncmp(".note", name, 5) + && strncmp(".note.gnu.build-id", name, 18)) || !strncmp(".gnu", name, 4) || !strncmp(".mod", name, 4)) ret = 0; |