From b1095f485ec41f083bb266ad0810cc6fa8fc1253 Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Mon, 21 Aug 2017 09:48:03 -0500 Subject: [PATCH] create-diff-object: handle .LCx symbol renames If an .LCx symbol gets renamed or changes sections, or if its section gets renamed, kpatch-build will get confused. They aren't *real* symbols, just string constants. So no need to correlate and compare them. Fixes #714. Fixes #727. --- kpatch-build/create-diff-object.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index 97781fd..5600089 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -546,6 +546,24 @@ static void kpatch_correlate_symbols(struct list_head *symlist1, struct list_hea if (is_special_static(sym1)) continue; + /* + * The .LCx symbols point to strings, usually used for + * the bug table. Don't correlate and compare the + * symbols themselves, because the suffix number might + * change. + * + * If the symbol is used by the bug table (usual case), + * it may get pulled in by + * kpatch_regenerate_special_section(). + * + * If the symbol is used outside of the bug table (not + * sure if this actually happens anywhere), any string + * changes will be detected elsewhere in rela_equal(). + */ + if (sym1->type == STT_NOTYPE && + !strncmp(sym1->name, ".LC", 3)) + continue; + /* group section symbols must have correlated sections */ if (sym1->sec && sym1->sec->sh.sh_type == SHT_GROUP &&