change struct kpatch_patch s/old_addr/old_offset

Make old addresses relative to the start address of the relocatable
kernel or module.

This commit has no functional effect; it just prepares the code for
future acceptance of the module patching support.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
avoid replicating strip logic

Just create a strip feild in the struct symbol the is marked if the
symbol needs to be stripped.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
avoid replicating dynrela logic

Rather than keep the logic in sync between the counting and processing
code in kpatch_create_dynamic_rela_sections() just do a "dumb" count
establishing an upper bound and allocating the buffer, then determine
the actual size (i.e. number of dynrelas) in the processing section.

No functional change intended.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
invert logic to reduce indentation

No functional change.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
exclude UNDEF global syms from lookup_global_symbol

Don't return a result for an UNDEF symbol

Signed-off-by: Seth Jennings <sjenning@redhat.com>
add module patching support to create-diff-object

This commit adds module patching support to create-diff-object by:

1) generalizing the vmlinux CLI parameter
2) adding the kernel object name to each patch and dynrela
3) adding slightly different logic for vmlinux/module in the dynrela
creation

Signed-off-by: Seth Jennings <sjenning@redhat.com>
add module patching support to core module

This commit adds support for patching modules.  If a patch or dynrela is
determined to be for a kernel module, the old_offset/src is not used and
the symbol location is looked up using kallsyms.  The module being
patched is also references to keep if from disappearing from underneath
us.

This commit introduces early and limited support.  The kernel module to
be patched must already be loaded or the patch module will not apply.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
add module for testing module patching

A simple kernel module for testing basic kernel module patching.

Just run doit.sh from test/testmod.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
review changes for module support PR

Signed-off-by: Seth Jennings <sjenning@redhat.com>
Merge pull request #227 from spartacus06/module-patching-support

Module patching support