Skip to content

ppc64le: [<localentry>: 8] readelf output messing with new_symbols file #994

@joe-lawrence

Description

@joe-lawrence

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"; then

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions