From e483cda793a333f4a1fe7645d187d02f067d5dc0 Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Fri, 8 Aug 2014 15:18:03 -0500 Subject: [PATCH] support renaming of mangled functions in unbundled sections Signed-off-by: Seth Jennings --- kpatch-build/create-diff-object.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index ab452c8..779db0a 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -765,9 +765,6 @@ void kpatch_rename_mangled_functions(struct kpatch_elf *base, !strstr(sym->name, ".part.")) continue; - if (sym != sym->sec->sym) - ERROR("expected bundled section for %s\n", sym->name); - /* prefix of foo.isra.1.constprop.2 is foo.isra */ prefix = strdup(sym->name); dot = strchr(prefix, '.'); @@ -784,6 +781,10 @@ void kpatch_rename_mangled_functions(struct kpatch_elf *base, log_debug("renaming %s to %s\n", sym->name, basesym->name); sym->name = strdup(basesym->name); + + if (sym != sym->sec->sym) + continue; + sym->sec->name = strdup(basesym->sec->name); if (sym->sec->rela) sym->sec->rela->name = strdup(basesym->sec->rela->name);