diff options
author | Amer Al Shanawany <amer.shanawany@gmail.com> | 2024-04-20 22:23:46 +0200 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-05-07 11:29:47 -0700 |
commit | d58c7353fd0178d94693d8735fbf39b8b6615eab (patch) | |
tree | 7e2cd5494a04020d948d3c50388da694014bdba0 | |
parent | 0c58a4285b800c92e465486ba4c95ff2beaa3854 (diff) |
selftests: mm: fix linker error for inline function
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>
-rw-r--r-- | tools/testing/selftests/mm/seal_elf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/mm/seal_elf.c b/tools/testing/selftests/mm/seal_elf.c index 7143dc4f1b10..f0cf96625e58 100644 --- a/tools/testing/selftests/mm/seal_elf.c +++ b/tools/testing/selftests/mm/seal_elf.c @@ -72,7 +72,7 @@ static void *sys_mmap(void *addr, unsigned long len, unsigned long prot, 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; |