From 08dc2ae78c8b5f78152136d9a158d2d81206c4ef Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Fri, 23 May 2014 16:32:17 -0500 Subject: [PATCH] change matching criteria for NULL sym Right now the matching criteria for the NULL sym is type LOCAL and shndx UNDEF. Unfortunately, that would also match any new LOCAL symbol added to the symbol table with uninit'd sym.* fields i.e. the upcoming __kpatch_strings and .kpatch.strings symbols. Change the matching criteria to be symbols that have a zero-length name; a property unique to the NULL sym. Signed-off-by: Seth Jennings --- kpatch-build/create-diff-object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index 0870905..adb37ff 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -836,7 +836,7 @@ void kpatch_migrate_symbols(struct list_head *src, int is_null_sym(struct symbol *sym) { - return sym->bind == STB_LOCAL && sym->sym.st_shndx == SHN_UNDEF; + return !strlen(sym->name); } int is_file_sym(struct symbol *sym)