diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index 1812fec24..6d43fef83 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -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; } diff --git a/test/unit/objs b/test/unit/objs index 8ef8049ca..0b34cbb7e 160000 --- a/test/unit/objs +++ b/test/unit/objs @@ -1 +1 @@ -Subproject commit 8ef8049ca314b5f9ffd19832992d4d4899b044a2 +Subproject commit 0b34cbb7e835706615d2295f8c3129a23e19f6e6