From aebb6187552ab0c23b91d3eca909202cac971575 Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Wed, 4 Jun 2014 12:07:46 -0500 Subject: [PATCH] create-diff-object: support adding new functions New functions (sym->status == NEW) shouldn't be added to the .kpatch.patches section. --- kpatch-build/create-diff-object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index f54ac24..5c4498c 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -1499,7 +1499,7 @@ void kpatch_create_patches_sections(struct kpatch_elf *kelf, /* count patched functions */ nr = 0; list_for_each_entry(sym, &kelf->symbols, list) - if (sym->type == STT_FUNC && sym->sec) + if (sym->type == STT_FUNC && sym->status == CHANGED) nr++; /* create .kpatch.patches */ @@ -1556,7 +1556,7 @@ void kpatch_create_patches_sections(struct kpatch_elf *kelf, /* populate sections */ index = 0; list_for_each_entry(sym, &kelf->symbols, list) { - if (sym->type == STT_FUNC && sym->sec) { + if (sym->type == STT_FUNC && sym->status == CHANGED) { if (sym->bind == STB_LOCAL) { if (lookup_local_symbol(table, sym->name, hint, &result))