Skip to content

Commit

Permalink
Merge pull request #973 from joe-lawrence/ppc64le-symtab-localentry
Browse files Browse the repository at this point in the history
kpatch-build: remove localentry data from ppc64le symtab
  • Loading branch information
joe-lawrence authored Jun 13, 2019
2 parents b34c6da + ff78bad commit 48a388a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
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

0 comments on commit 48a388a

Please sign in to comment.