mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 14:12:06 +00:00
tools/nolibc/string: export strlen()
As with commit 8d304a3740
, "tools/nolibc/string: export memset() and
memmove()", gcc -Os without -ffreestanding may fail to compile with:
cc -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib -lgcc -static -o test test.c
/usr/bin/ld: /tmp/cccIasKL.o: in function `main':
test.c:(.text.startup+0x1e): undefined reference to `strlen'
collect2: error: ld returned 1 exit status
As on the aforementioned commit, this patch adds a section to export
this function so compilation works on those cases too.
Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
This commit is contained in:
parent
791f464114
commit
689230b674
@ -123,7 +123,7 @@ char *strcpy(char *dst, const char *src)
|
||||
* thus itself, hence the asm() statement below that's meant to disable this
|
||||
* confusing practice.
|
||||
*/
|
||||
static __attribute__((unused))
|
||||
__attribute__((weak,unused,section(".text.nolibc_strlen")))
|
||||
size_t strlen(const char *str)
|
||||
{
|
||||
size_t len;
|
||||
|
Loading…
Reference in New Issue
Block a user