kpatch/kpatch-build
chenzefeng eb4f5833e0 kpatch-build: find_parent_obj should search subdirs
The kpatch-build :: find_parent_obj() function's "deep find" may
failed to find objects if they are not located in current directory:

	ERROR: invalid ancestor xxx/xxx.o for xxx/xxx.o.

This is reproducable when building an out-of-tree module of the
following structure:

	wwheart@linux41:~/helloworld 0 > tree -a
	.
	├── buffer_overflow1.ko
	├── .buffer_overflow1.ko.cmd
	├── buffer_overflow1.mod.c
	├── buffer_overflow1.mod.o
	├── .buffer_overflow1.mod.o.cmd
	├── buffer_overflow1.o
	├── .buffer_overflow1.o.cmd
	├── hello.c
	├── hello.o
	├── .hello.o.cmd
	├── Makefile
	├── modules.order
	├── Module.symvers
	├── test.patch
	├── .tmp_versions
	│   └── buffer_overflow1.mod
	└── xxx
	    ├── xxx.c
	    ├── xxx.h
	    ├── xxx.o
	    └── .xxx.o.cmd

	wwheart@linux41:~/helloworld 0 > cat test.patch
	diff --git a/xxx/xxx.c b/xxx/xxx.c
	index aab3c67..d81ad00 100644
	--- a/xxx/xxx.c
	+++ b/xxx/xxx.c
	@@ -1,6 +1,7 @@
	#include <linux/kernel.h>
	void czf_test(void)
	{
	+       printk("livepatch test\n");
		printk("xxx\n");
	}

	wwheart@linux41:~/helloworld 0 > cat Makefile
	obj-m += buffer_overflow1.o
	buffer_overflow1-y += hello.o xxx/xxx.o

Modify the deep find to traverse sub-directories in order to search
the entire tree instead of only the current directory.

Fixes: 8c2792af6c ("kpatch-build: deep find performance improvement")

Signed-off-by: chenzefeng <chenzefeng2@huawei.com>
2019-05-07 15:41:18 +08:00
..
gcc-plugins gcc-plugin: Include additional header for GCC 8 2018-05-30 19:39:48 +05:30
insn insn: get it to compile in create-diff-object 2014-05-30 15:19:57 -05:00
create-diff-object.c create-diff-objject: fix memleak of the struct lookup_table 2019-04-18 10:15:29 +08:00
create-klp-module.c fix memleak in the create-klp-module.c 2019-04-26 11:37:19 +08:00
create-kpatch-module.c Fix multiple sign-compare warnings 2018-04-13 16:26:06 +02:00
kpatch-build kpatch-build: find_parent_obj should search subdirs 2019-05-07 15:41:18 +08:00
kpatch-elf.c kpatch-build: fix memleak in function kpatch_write_output_elf 2019-04-12 17:09:10 +08:00
kpatch-elf.h create-diff-object: add symbol relations 2018-07-11 09:57:31 +02:00
kpatch-gcc kpatch-gcc: use relative path when filtering objects to ignore 2019-02-15 10:10:24 -05: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: Fix memleak in symtab_read() 2019-04-23 12:03:17 +05:30
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