* [PATCH] selftests: mm: fix linker error for inline function
@ 2024-04-20 20:23 Amer Al Shanawany
0 siblings, 0 replies; only message in thread
From: Amer Al Shanawany @ 2024-04-20 20:23 UTC (permalink / raw)
To: Andrew Morton, Shuah Khan, linux-mm, linux-kselftest, linux-kernel
Cc: Javier Carrasco
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'
Signed-off-by: Amer Al Shanawany <amer.shanawany@gmail.com>
---
tools/testing/selftests/mm/seal_elf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.34.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-20 20:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-20 20:23 [PATCH] selftests: mm: fix linker error for inline function Amer Al Shanawany
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).