lkdtm: mark execute_location as noinline
The kernel sometimes fails to link when lkdrm is built-in and compiled with clang: relocation truncated to fit: R_ARM_THM_CALL against `.bss' The reason here is that a relocation from .text to .bss fails to generate a trampoline because .bss is not an executable section. Marking the function 'noinline' turns the relative branch to .bss into an absolute branch to the function argument, and that works fine. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c074abe02e
commit
ececdc021b
|
@ -335,7 +335,7 @@ static noinline void corrupt_stack(void)
|
|||
memset((void *)data, 0, 64);
|
||||
}
|
||||
|
||||
static void execute_location(void *dst)
|
||||
static void noinline execute_location(void *dst)
|
||||
{
|
||||
void (*func)(void) = dst;
|
||||
|
||||
|
|
Loading…
Reference in a new issue