summaryrefslogtreecommitdiffstats
path: root/tools/include/nolibc/stdlib.h
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2022-02-07 17:23:44 +0100
committerPaul E. McKenney <paulmck@kernel.org>2022-04-21 02:05:45 +0200
commit07f47ea06fe9d38c5e8d9068fba2468ed8bb8b59 (patch)
tree1d0f2aae37ca62815b334841bf63b0b60b79182f /tools/include/nolibc/stdlib.h
parenttools/nolibc/string: add tiny versions of strncat() and strlcat() (diff)
downloadlinux-07f47ea06fe9d38c5e8d9068fba2468ed8bb8b59.tar.xz
linux-07f47ea06fe9d38c5e8d9068fba2468ed8bb8b59.zip
tools/nolibc: move exported functions to their own section
Some functions like raise() and memcpy() are permanently exported because they're needed by libgcc on certain platforms. However most of the time they are not needed and needlessly take space. Let's move them to their own sub-section, called .text.nolibc_<function>. This allows ld to get rid of them if unused when passed --gc-sections. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/include/nolibc/stdlib.h')
-rw-r--r--tools/include/nolibc/stdlib.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/include/nolibc/stdlib.h b/tools/include/nolibc/stdlib.h
index 4cc1fdf6791e..da08ff30c15a 100644
--- a/tools/include/nolibc/stdlib.h
+++ b/tools/include/nolibc/stdlib.h
@@ -314,7 +314,7 @@ int msleep(unsigned int msecs)
}
/* This one is not marked static as it's needed by libgcc for divide by zero */
-__attribute__((weak,unused))
+__attribute__((weak,unused,section(".text.nolibc_raise")))
int raise(int signal)
{
return sys_kill(sys_getpid(), signal);