blob: b80d17bcd98a1c8992a792b17e01e8d456d6eaf4 [file] [log] [blame]
From: Amer Al Shanawany <amer.shanawany@gmail.com>
Subject: selftests: mm: fix linker error for inline function
Date: Sat, 20 Apr 2024 22:23:46 +0200
add 'static' keyword to 'sys_mprotect()' to link properly, otherwise the
test won't build.
gcc (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
/usr/bin/ld: /tmp/cc7yeABp.o: in function `test_seal_elf':
seal_elf.c:(.text+0x7af): undefined reference to `sys_mprotect'
/usr/bin/ld: seal_elf.c:(.text+0x82c): undefined reference to
`sys_mprotect'
/usr/bin/ld: seal_elf.c:(.text+0xa4e): undefined reference to
`sys_mprotect'
Link: https://lkml.kernel.org/r/20240420202346.546444-1-amer.shanawany@gmail.com
Signed-off-by: Amer Al Shanawany <amer.shanawany@gmail.com>
Cc: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Jeff Xu <jeffxu@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
tools/testing/selftests/mm/seal_elf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/tools/testing/selftests/mm/seal_elf.c~selftest-mm-mseal-read-only-elf-memory-segment-fix-2
+++ a/tools/testing/selftests/mm/seal_elf.c
@@ -72,7 +72,7 @@ static void *sys_mmap(void *addr, unsign
return sret;
}
-inline int sys_mprotect(void *ptr, size_t size, unsigned long prot)
+static inline int sys_mprotect(void *ptr, size_t size, unsigned long prot)
{
int sret;
_