From: Amer Al Shanawany <amer.shanawany@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <shuah@kernel.org>,
linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Subject: [PATCH] selftests: mm: fix linker error for inline function
Date: Sat, 20 Apr 2024 22:23:46 +0200 [thread overview]
Message-ID: <20240420202346.546444-1-amer.shanawany@gmail.com> (raw)
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
reply other threads:[~2024-04-20 20:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240420202346.546444-1-amer.shanawany@gmail.com \
--to=amer.shanawany@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=javier.carrasco.cruz@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox