The KLP API doesn't take a flat list of to be patched functions
like KGraft did, but introduces an intermediate layer: struct
klp_object.
Each klp_patch instance is supposed to reference an array of
klp_object's which in turn provide an array of klp_func's each.
To facilitate merging, we want to generate this list of klp_object's
automatically, exactly like we did for the flat function list with KGraft.
For each klp_patch instance, there must be at most one klp_object entry
referring to the same object.
Hence care must be taken not to add an entry for the same object twice
in case two different (sub-)patches both patch some functions therein.
Require from each (sub-)patch to provide the list of to be patched
symbols in a file named SUBPATCH/patched_funcs.csv with each line
conforming to the
obj old_func(,sympos) new_func
pattern.
Make scripts/register.sh generate an klp_object array initializer based on
this and let it expand the @@KLP_PATCHES_OBJS@@ tag within livepatch_main.c
accordingly.
Do not replace the now obsolete @@KLP_PATCHES_FUNCS@@ anymore.
Add and remove the @@KLP_PATCHES_OBJS@@ and @@KLP_PATCHES_FUNCS@@
markers to and from livepatch_main.c respectively.
Signed-off-by: Nicolai Stange <nstange@suse.de>
[ mb: amend copy&paste error ($newfun at the end of uname klp_func[]) ]
Signed-off-by: Miroslav Benes <mbenes@suse.cz>