]> git.baikalelectronics.ru Git - kernel.git/commit
lib: Fix ia64 bootloader linkage
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Tue, 16 Oct 2018 11:13:40 +0000 (14:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Oct 2018 11:45:44 +0000 (13:45 +0200)
commit8df0feed021900d4b05ff97ceeef0d7c8ca3611c
tree0f226cb0985cb48fc52e13eca3fed13bceefa9e2
parent23a628b9ff007dd2190c98fc770fc4a4f152e44d
lib: Fix ia64 bootloader linkage

kbuild robot reports that since commit 84452f6c35b9 ("lib: Add memcat_p():
paste 2 pointer arrays together") the ia64/hp/sim/boot fails to link:

> LD      arch/ia64/hp/sim/boot/bootloader
> lib/string.o: In function `__memcat_p':
> string.c:(.text+0x1f22): undefined reference to `__kmalloc'
> string.c:(.text+0x1ff2): undefined reference to `__kmalloc'
> make[1]: *** [arch/ia64/hp/sim/boot/Makefile:37: arch/ia64/hp/sim/boot/bootloader] Error 1

The reason is, the above commit, via __memcat_p(), adds a call to
__kmalloc to string.o, which happens to be used in the bootloader, but
there's no kmalloc or slab or anything.

Since the linker would only pull in objects that contain referenced
symbols, moving __memcat_p() to a different compilation unit solves the
problem.

Fixes: 84452f6c35b9 ("lib: Add memcat_p(): paste 2 pointer arrays together")
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reported-by: kbuild test robot <lkp@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/Makefile
lib/memcat_p.c [new file with mode: 0644]
lib/string.c
lib/test_memcat_p.c