From 2949597251fea7f17a0e46c1c885e34b53395d18 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Mon, 6 Oct 2008 03:07:09 -0400 Subject: 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. --- runtime/staprun/staprun.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/staprun/staprun.c') diff --git a/runtime/staprun/staprun.c b/runtime/staprun/staprun.c index f8a08876..d23945e6 100644 --- a/runtime/staprun/staprun.c +++ b/runtime/staprun/staprun.c @@ -370,6 +370,11 @@ int send_relocation_kernel () } fclose (kallsyms); if (!done_with_kallsyms) srkrc = -1; + /* detect note section, send flag if there + * NB: address=2 represents existed note, the real one in _stp_module + */ + if (srkrc != -1 && !access("/sys/kernel/notes", R_OK)) + send_a_relocation ("kernel", ".note.gnu.build-id", 2); } return srkrc; -- cgit