]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 8220/1: allow modules outside of bl range
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 24 Nov 2014 15:54:35 +0000 (16:54 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 8 May 2015 09:42:34 +0000 (10:42 +0100)
commitd42b313aa0a46ad052c007333c1431adc4ca4d46
tree1ddeb6618cebf5b4a48ca225de772120b734e701
parentf7d0ddb3d90d821f6d632305e0845731460deff9
ARM: 8220/1: allow modules outside of bl range

Loading modules far away from the kernel in memory is problematic
because the 'bl' instruction only has limited reach, and modules are not
built with PLTs. Instead of using the -mlong-calls option (which affects
all compiler emitted bl instructions, but not the ones in assembler),
this patch allocates some additional space at module load time, and
populates it with PLT like veneers when encountering relocations that
are out of range.

This should work with all relocations against symbols exported by the
kernel, including those resulting from GCC generated implicit function
calls for ftrace etc.

The module memory size increases by about 5% on average, regardless of
whether any PLT entries were actually needed. However, due to the page
based rounding that occurs when allocating module memory, the average
memory footprint increase is negligible.

Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/include/asm/module.h
arch/arm/kernel/Makefile
arch/arm/kernel/module-plts.c [new file with mode: 0644]
arch/arm/kernel/module.c
arch/arm/kernel/module.lds [new file with mode: 0644]