-
Notifications
You must be signed in to change notification settings - Fork 336
Closed
Description
While testing PR #993, I noticed these odd entries in the new_symbols file:
% cat ~/.kpatch/tmp/new_symbols
__this_module
8] << what are these?
8] <<
.klp.sym.vmlinux.proc_task_name,0
.klp.sym.vmlinux.render_sigset_t,0
Which are easily explainable when looking at the code that generates the file (and dumping the entire line, not just the last field):
% readelf --wide --symbols ~/.kpatch/tmp/patch/livepatch-test.ko | \
awk '($4=="FUNC" || $4=="OBJECT") && ($5=="GLOBAL" || $5=="WEAK") && $7!="UND" {print $0}'
67: 0000000000000000 1024 OBJECT GLOBAL DEFAULT 39 __this_module
71: 0000000000000008 84 FUNC GLOBAL DEFAULT 8 cleanup_module [<localentry>: 8]
77: 0000000000000008 1220 FUNC GLOBAL DEFAULT 6 init_module [<localentry>: 8]
110: 0000000000000000 0 FUNC GLOBAL DEFAULT OS [0xff20] .klp.sym.vmlinux.proc_task_name,0
115: 0000000000000000 0 FUNC GLOBAL DEFAULT OS [0xff20] .klp.sym.vmlinux.render_sigset_t,0
@kamalesh-babulal, should we be filtering this readelf output like we do for the SYMTAB file? Untested:
diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build
index 84d502b691fd..e670e9e1292c 100755
--- a/kpatch-build/kpatch-build
+++ b/kpatch-build/kpatch-build
@@ -936,6 +936,7 @@ fi
readelf --wide --symbols "$TEMPDIR/patch/$MODNAME.ko" 2>/dev/null | \
awk '($4=="FUNC" || $4=="OBJECT") && ($5=="GLOBAL" || $5=="WEAK") && $7!="UND" {print $NF}' \
+ sed -r 's/\s+\[<localentry>: 8\]//' | \
>"${TEMPDIR}"/new_symbols
if "$KPATCH_MODULE"; thenMetadata
Metadata
Assignees
Labels
No labels