Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions kpatch-build/kpatch-build
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,9 @@ for i in $FILES; do
fi

readelf -s --wide "$KOBJFILE_PATH" > "$SYMTAB"
if [[ "$ARCH" = "ppc64le" ]]; then
sed -ri 's/\s+\[<localentry>: 8\]//' "$SYMTAB"
fi

# create-diff-object orig.o patched.o parent-name parent-symtab
# Module.symvers patch-mod-name output.o
Expand Down
23 changes: 4 additions & 19 deletions kpatch-build/lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,8 @@ static void symtab_read(struct lookup_table *table, char *path)
ERROR("fopen");

while (fgets(line, 256, file)) {
if (strstr(line, "[<localentry>: 8]")) {
/*
* 23: 0000000000000008 96 FUNC LOCAL DEFAULT [<localentry>: 8] 4 cmdline_proc_show
* On Power, local func syms Ndx is preceded with "[<localentry>: 8]"
* denoting local entry point offset of the function.
*/
matched = sscanf(line, "%*s %lx %s %s %s %*s [<localentry>: 8] %s %s\n",
&value, size, type, bind, ndx, name);
} else {
matched = sscanf(line, "%*s %lx %s %s %s %*s %s %s\n",
&value, size, type, bind, ndx, name);
}
matched = sscanf(line, "%*s %lx %s %s %s %*s %s %s\n",
&value, size, type, bind, ndx, name);

if (matched == 5) {
name[0] = '\0';
Expand All @@ -243,13 +233,8 @@ static void symtab_read(struct lookup_table *table, char *path)
rewind(file);

while (fgets(line, 256, file)) {
if (strstr(line, "[<localentry>: 8]")) {
matched = sscanf(line, "%*s %lx %s %s %s %*s [<localentry>: 8] %s %s\n",
&value, size, type, bind, ndx, name);
} else {
matched = sscanf(line, "%*s %lx %s %s %s %*s %s %s\n",
&value, size, type, bind, ndx, name);
}
matched = sscanf(line, "%*s %lx %s %s %s %*s %s %s\n",
&value, size, type, bind, ndx, name);

if (matched == 5) {
name[0] = '\0';
Expand Down