kpatch/kpatch-build
Josh Poimboeuf 935f199875 create-diff-object: simplify mangled function correlation
The RHEL powerpc kernel is compiled with -O3, which triggers some
"interesting" new optimizations.  One of them, which seems to be
relatively common, is the replacing of a function with two separate
"constprop" functions.

Previously we only ever saw a single constprop clone, so we just renamed
the patched version of the function to match the original version.  Now
that we can have two such clones, that no longer makes sense.

Instead of renaming functions, just improve the correlation logic such
that they can be correlated despite having slightly different symbol
names.  The first clone in the original object is correlated with the
first clone in the patched object; the second clone is correlated with
the second clone; and so on.

This assumes that the order of the symbols and sections doesn't change,
which seems to be a reasonable assumption based on past experience with
the compiler.  Otherwise it will just unnecessarily mark the cloned
constprop functions as changed, which is annoying but harmless, and
noticeable by a human anyway.

Fixes #935.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2019-10-03 09:38:29 -05:00
..
gcc-plugins gcc-plugin: Include additional header for GCC 8 2018-05-30 19:39:48 +05:30
insn
create-diff-object.c create-diff-object: simplify mangled function correlation 2019-10-03 09:38:29 -05:00
create-klp-module.c create-klp-module: check symtab in main() 2019-08-05 12:10:47 +02:00
create-kpatch-module.c create-kpatch-module: check symtab in main() 2019-08-05 12:10:47 +02:00
kpatch-build kpatch-build: use whole word filename matching in find_parent_obj() 2019-09-27 09:36:39 +08:00
kpatch-elf.c kpatch-elf: add a couple mission section checks 2019-08-05 12:10:47 +02:00
kpatch-elf.h create-diff-object: add symbol relations 2018-07-11 09:57:31 +02:00
kpatch-gcc Making kpatch-build compatible with custom gcc names 2019-05-09 19:15:11 +02:00
kpatch-intermediate.h create-klp-module: get rid of redundant kpatch_relocation.offset field 2017-11-09 19:16:14 -06:00
kpatch.h kpatch-build: add exit status enum 2018-06-15 07:11:48 -04:00
list.h new .fixup group size algorithm 2014-09-15 14:54:57 -05:00
log.h kpatch-build: add exit status enum 2018-06-15 07:11:48 -04:00
lookup.c lookup: exit on error in make_modname() 2019-08-05 12:10:47 +02:00
lookup.h kpatch-build: use symbol table instead of kobject 2018-05-18 09:24:40 +02:00
Makefile ppc64le: fix gcc-plugin installation 2018-04-19 10:16:37 +02:00