From b1131bfeb694ca3dbacce492889da98ca4c99a15 Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Mon, 26 May 2014 22:51:58 -0500 Subject: [PATCH] create-diff-object: fix symbol section indexes For a local non-included function or object which is needed by an included function, its symbol table entry will still refer to a local section index. Instead it should be changed to SHN_UNDEF. --- kpatch-build/create-diff-object.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index 251f420..2ced0a6 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -982,6 +982,8 @@ void kpatch_reindex_elements(struct kpatch_elf *kelf) sym->index = index++; if (sym->sec) sym->sym.st_shndx = sym->sec->index; + else if (sym->sym.st_shndx != SHN_ABS) + sym->sym.st_shndx = SHN_UNDEF; } }