Commit 07f47ea0 authored by Willy Tarreau's avatar Willy Tarreau Committed by Paul E. McKenney

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: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent d9390de6
...@@ -314,7 +314,7 @@ int msleep(unsigned int msecs) ...@@ -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 */ /* 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) int raise(int signal)
{ {
return sys_kill(sys_getpid(), signal); return sys_kill(sys_getpid(), signal);
......
...@@ -69,7 +69,7 @@ void *memmove(void *dst, const void *src, size_t len) ...@@ -69,7 +69,7 @@ void *memmove(void *dst, const void *src, size_t len)
} }
/* must be exported, as it's used by libgcc on ARM */ /* must be exported, as it's used by libgcc on ARM */
__attribute__((weak,unused)) __attribute__((weak,unused,section(".text.nolibc_memcpy")))
void *memcpy(void *dst, const void *src, size_t len) void *memcpy(void *dst, const void *src, size_t len)
{ {
return _nolibc_memcpy_up(dst, src, len); return _nolibc_memcpy_up(dst, src, len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment