From 7a541bbd6ab9399bc5f6df37547bf4c699aabb41 Mon Sep 17 00:00:00 2001 From: Jessica Yu Date: Sun, 15 Jun 2014 21:32:08 -0700 Subject: [PATCH 1/2] README: Update outdated readme kpatch-build no longer uses add-patches-section and link-vmlinux-syms. --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 48079136a..c78bccc2b 100644 --- a/README.md +++ b/README.md @@ -172,8 +172,7 @@ ones. It has four main components: The "kpatch-build" command converts a source-level diff patch file to a kernel patch module. Most of its work is performed by the kpatch-build script -which uses a collection of utilities: `create-diff-object`, -`add-patch-section`, and `link-vmlinux-syms`. +which uses a utility named `create-diff-object` to compare changed objects. The primary steps in kpatch-build are: - Build the unstripped vmlinux for the kernel @@ -185,16 +184,17 @@ The primary steps in kpatch-build are: - Unpatch the source tree - Recompile each changed object with `-ffunction-sections -fdata-sections`, resulting in the changed original objects -- Use `create-diff-object` to analyze each original/patched object pair - for patchability and generate an output object containing modified - sections +- For every changed object, use `create-diff-object` to do the following: + * Analyze each original/patched object pair for patchability + * Add .kpatches.patches and .rela.kpatch.patches sections to the output object. + The kpatch core module uses this to determine the list of functions + that need to be redirected using ftrace. + * Add .kpatches.dynrelas and .rela.kpatch.dynrelas sections to the output object. + This will be used to resolve references to non-included local + and non-exported global symbols. These relocations will be resolved by the kpatch core module. + * Generate the resulting output object containing the new and modified sections - Link all the output objects into a cumulative object -- Use `add-patches-section` to add the .patches section that the - kpatch core module uses to determine the list of functions that need - to be redirected using ftrace - Generate the patch module -- Use `link-vmlinux-syms` to hardcode non-exported kernel symbols - into the symbol table of the patch module ### Patching From 4dc2555e99f31837fe3fede93799c944e02a64f4 Mon Sep 17 00:00:00 2001 From: Jessica Yu Date: Sun, 15 Jun 2014 21:40:48 -0700 Subject: [PATCH 2/2] README: fix formatting and typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c78bccc2b..2d2f8f659 100644 --- a/README.md +++ b/README.md @@ -186,10 +186,10 @@ The primary steps in kpatch-build are: resulting in the changed original objects - For every changed object, use `create-diff-object` to do the following: * Analyze each original/patched object pair for patchability - * Add .kpatches.patches and .rela.kpatch.patches sections to the output object. + * Add `.kpatch.patches` and `.rela.kpatch.patches` sections to the output object. The kpatch core module uses this to determine the list of functions that need to be redirected using ftrace. - * Add .kpatches.dynrelas and .rela.kpatch.dynrelas sections to the output object. + * Add `.kpatch.dynrelas` and `.rela.kpatch.dynrelas` sections to the output object. This will be used to resolve references to non-included local and non-exported global symbols. These relocations will be resolved by the kpatch core module. * Generate the resulting output object containing the new and modified sections