Skip to content

Commit

Permalink
Merge pull request #1007 from jpoimboe/ppc-replace-sections-syms
Browse files Browse the repository at this point in the history
create-diff-object/ppc64le: Fix replace_sections_syms() for bundled s…
  • Loading branch information
jpoimboe authored Jul 24, 2019
2 parents f96691f + cef3360 commit 814fc06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions kpatch-build/create-diff-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,15 @@ static void kpatch_replace_sections_syms(struct kpatch_elf *kelf)
if (rela->sym->sec && rela->sym->sec->sym) {
rela->sym = rela->sym->sec->sym;

/*
* On ppc64le with GCC6+, the function symbol
* starts 8 bytes past the beginning of the
* section, because of localentry. So even
* though the symbol is bundled, we can't
* assume it's at offset 0 in the section.
*/
rela->addend -= rela->sym->sym.st_value;

continue;
}

Expand Down

0 comments on commit 814fc06

Please sign in to comment.