test/testmod/doit.sh: set KBUILD_EXTRA_SYMBOLS to include core module
symbols
fix bad Module.symvers path

Signed-off-by: Seth Jennings <sjenning@redhat.com>
restructure building process

Right now, we do three build passes: one to build the original tree
(full) build, one to build the patch tree (diff build), then one to
rebuild original objects that where changed by the patch (diff build).

This is going to be a problem when we try to support (near) full tree
rebuilds due to changes in commonly included header files.

This commit changes the build process to intercept calls to gcc by make
using the CROSS_COMPILE environment variable and, during the patched
build phase, copies the original object for any object that is about to
rebuilt due to a change.

This reduces the number of build passes to the minimum possible (two).

Signed-off-by: Seth Jennings <sjenning@redhat.com>
Merge pull request #347 from spartacus06/change-build

restructure building process
allow for unchanged objects

There are situations in which an object may be rebuilt but have no
functional changes, such as a change to an included header file.

This commit changes kpatch-build to tolerate individual unchanged
objects so long as there is, in the end, at least one changed object.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
Merge pull request #348 from spartacus06/allow-unchanged-object

allow for unchanged objects
kpatch-gcc: split up object exclusion list
kpatch-gcc: exclude system_certificates.o

Fixes the following issue when running kpatch-build against the latest
upstream kernel:

    system_certificates.o: no changed functions were found
kpatch-build: don't link unchanged objects

The FILES variable can contain unchanged objects, so don't use it to
determine which objects to link.  Instead, just use all the objects that
were placed in the output directory by create-diff-object.
Merge pull request #349 from jpoimboe/system_certificates

upstream kernel fixes
support renaming of mangled functions in unbundled sections

Signed-off-by: Seth Jennings <sjenning@redhat.com>
Merge pull request #350 from spartacus06/support-unbundled-mangled-functions

support renaming of mangled functions in unbundled sections
Merge pull request #346 from flaming-toast/testmod

testmod/doit.sh: set KBUILD_EXTRA_SYMBOLS to include core module's symbols
add correlation and compare support for GROUP sections

GROUP section are rare and are a mechanism in the ELF to indicated that
certain groups of section must be included or excluded (stripped)
together.

It is valid to have more than one of these section with the same
".group" name.  This currently messes up the section correlation code
with correlates based solely on name.

This commit adds additional correlation criteria for GROUP sections;
namely, the section content must be the same.  Changing of groups
sections (i.e. reindexing of the section indexes the GROUP section
includes in their section data) is not supported and will result in a
"new/changed section not included" error.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
cleanup kpatch_correlate_symbols()

This commit inverts some logic to reduce the max indentation

Signed-off-by: Seth Jennings <sjenning@redhat.com>
review fixups

Signed-off-by: Seth Jennings <sjenning@redhat.com>
Merge pull request #353 from spartacus06/group-section-support

Group section support
add difftest.sh test

The purpose of this test script is to determine if create-diff-object
can properly recognize object file equivalence when passed the same file
for both the original and patched objects.  This verifies that
create-diff-object is correctly parsing, correlating, and comparing the
different elements of the object file.  In practice, a situation similar
to the test case occurs when a commonly included header file changes,
causing Make to rebuild many objects that have no functional change.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
Merge pull request #354 from spartacus06/diff-tree-tests

add difftest.sh test
Merge remote-tracking branch 'upstream/master'