From 3f30177c9112792f3d1a1728b14335b94d70f9fd Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Sun, 28 Jun 2009 13:16:42 -0400 Subject: libc.so: include all output formats in linker script Rather than ripping out the default output format from the linker, include the big/little endian alternatives for the people who link with bi-endian toolchains. URL: http://lists.uclibc.org/pipermail/uclibc/2009-June/042595.html Signed-off-by: Steve Bennett Signed-off-by: Mike Frysinger --- libc/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libc') diff --git a/libc/Makefile.in b/libc/Makefile.in index 16768db11..7297e9284 100644 --- a/libc/Makefile.in +++ b/libc/Makefile.in @@ -54,7 +54,7 @@ lib-gdb-y += $(top_builddir)lib/libc.gdb lib-so-y += $(libc.depend) objclean-y += libc_clean -OUTPUT_FORMAT = $(CC) $(CFLAGS) -Wl,--verbose 2>&1 | $(SED) -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/OUTPUT_FORMAT ( \1 )/p' +OUTPUT_FORMAT = $(CC) $(CFLAGS) -Wl,--verbose 2>&1 | $(SED) -n '/OUTPUT_FORMAT/,/)/p' ifeq ($(DOMULTI),n) $(libc.depend): $(libc_OUT)/libc_so.a $(LIBS-libc.so) @@ -65,7 +65,7 @@ $(libc.depend): $(libc_OUT)/libc.oS $(libc-nomulti-y:.o=.oS) | $(LIBS-libc.so) endif $(Q)$(RM) $@ $(Q)cp $(top_srcdir)extra/scripts/format.lds $@ - $(Q)echo "$(shell $(OUTPUT_FORMAT))" >> $@ + $(Q)$(OUTPUT_FORMAT) >> $@ ifeq ($(COMPAT_ATEXIT),y) $(Q)echo "GROUP ( $(NONSHARED_LIBNAME) $(SHARED_MAJORNAME) $(ASNEEDED) )" >> $@ else -- cgit v1.2.3 From 6f49b76f5c589bc40aceed3d14ce25e40b476f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Goddard=20Rosa?= Date: Tue, 2 Jun 2009 09:36:28 -0300 Subject: wchar: fix inverted parameters in error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The error message should output "fromcode -> tocode" rather than "tocode -> fromcode". Seems to be a typo due to the order of the func called: iconv_t iconv_open(const char *tocode, const char *fromcode); Signed-off-by: André Goddard Rosa Signed-off-by: Mike Frysinger --- libc/misc/wchar/wchar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc') diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c index 1ca4600b4..099ac3935 100644 --- a/libc/misc/wchar/wchar.c +++ b/libc/misc/wchar/wchar.c @@ -1679,7 +1679,7 @@ int main(int argc, char **argv) goto USAGE; } if ((ic = iconv_open(opts[0],opts[1])) == ((iconv_t)(-1))) { - error_msg( "unsupported codeset in %s -> %s conversion\n", opts[0], opts[1]); + error_msg( "unsupported codeset in %s -> %s conversion\n", opts[1], opts[0]); } if (opts[3]) { /* -c */ ((_UC_iconv_t *) ic)->skip_invalid_input = 1; -- cgit v1.2.3 From 60e244a98fbaa4c8637dd1c3147979633e5179aa Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sun, 28 Jun 2009 23:48:09 +0000 Subject: Add missing CLIBABI variables __aeabi_stdin, __aeabi_stdout, __aeabi_stderr. The ARM EABI has a document CLIBABI specifying various __aeabi_* functions and variables to be provided for the use of portable objects that can be linked with different EABI-conforming C libraries. __aeabi_stdin, __aeabi_stdout and __aeabi_stderr were missing in uClibc; this patch (originally from Nathan Froyd and for glibc) adds them. Signed-off-by: Joseph Myers --- libc/sysdeps/linux/arm/aeabi_lcsts.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libc') diff --git a/libc/sysdeps/linux/arm/aeabi_lcsts.c b/libc/sysdeps/linux/arm/aeabi_lcsts.c index 99c79851e..0c620d4fe 100644 --- a/libc/sysdeps/linux/arm/aeabi_lcsts.c +++ b/libc/sysdeps/linux/arm/aeabi_lcsts.c @@ -81,4 +81,19 @@ eabi_constant (TMP_MAX); eabi_constant (FILENAME_MAX); eabi_constant (L_tmpnam); +FILE *__aeabi_stdin attribute_hidden; +FILE *__aeabi_stdout attribute_hidden; +FILE *__aeabi_stderr attribute_hidden; + +static void __attribute__ ((used)) +setup_aeabi_stdio (void) +{ + __aeabi_stdin = stdin; + __aeabi_stdout = stdout; + __aeabi_stderr = stderr; +} + +static void (*fp) (void) __attribute__ ((used, section (".preinit_array"))) + = setup_aeabi_stdio; + eabi_constant (CLOCKS_PER_SEC); -- cgit v1.2.3 From ea697ec9ea1cd82f8eb21c2a70bccc9e760bcc7a Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 30 Jun 2009 21:16:56 +0000 Subject: Fix Thumb-2 memcpy. When an IT block was changed from having two instructions to having one, the IT instruction at the start of the block was not updated, causing memcpy to fail to assemble for Thumb-2; this patch makes the obvious fix. Signed-off-by: Joseph Myers --- libc/string/arm/_memcpy.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc') diff --git a/libc/string/arm/_memcpy.S b/libc/string/arm/_memcpy.S index 103580a0c..1dc0887a4 100644 --- a/libc/string/arm/_memcpy.S +++ b/libc/string/arm/_memcpy.S @@ -108,7 +108,7 @@ _memcpy: cmp r1, r0 bcc .Lmemcpy_backwards - IT(tt, eq) /* Quick abort for src=dst */ + IT(t, eq) /* Quick abort for src=dst */ #if defined(__USE_BX__) bxeq lr #else -- cgit v1.2.3 From 77c075f4ea2d9a625f35292063bd627e2e8fdf10 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 30 Jun 2009 21:20:26 +0000 Subject: Fix Thumb-2 setjmp. Many Thumb-2 instructions cannot use sp or pc as operands, and the assembler now diagnoses these. setjmp had one such instruction, movs; this patch changes it to mov. Signed-off-by: Joseph Myers --- libc/sysdeps/linux/arm/setjmp.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc') diff --git a/libc/sysdeps/linux/arm/setjmp.S b/libc/sysdeps/linux/arm/setjmp.S index 2df7d551a..76d179043 100644 --- a/libc/sysdeps/linux/arm/setjmp.S +++ b/libc/sysdeps/linux/arm/setjmp.S @@ -47,7 +47,7 @@ __sigsetjmp: mov ip, r0 #if defined(__thumb2__) stmia ip!, {v1-v6, sl, fp} - movs r2, sp + mov r2, sp stmia ip!, {r2, lr} #else /* Save registers */ -- cgit v1.2.3 From 801626b26745a1bd24cbf56c3d8720204a1db95d Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 1 Jul 2009 14:37:15 +0000 Subject: Correct ARM memcpy comments. The comments on register usage in ARM memcpy had dest and src the wrong way round; this patch (originally from Mark Shinwell) corrects this and adds a note on the return value. Signed-off-by: Joseph Myers --- libc/string/arm/_memcpy.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libc') diff --git a/libc/string/arm/_memcpy.S b/libc/string/arm/_memcpy.S index 1dc0887a4..b26080d02 100644 --- a/libc/string/arm/_memcpy.S +++ b/libc/string/arm/_memcpy.S @@ -67,8 +67,9 @@ * a time where possible. * * Note: r12 (aka ip) can be trashed during the function along with - * r0-r3 although r0-r2 have defined uses i.e. src, dest, len through out. + * r0-r3 although r0-r2 have defined uses i.e. dest, src, len throughout. * Additional registers are preserved prior to use i.e. r4, r5 & lr + * The return value in r0 must be the destination address. * * Apologies for the state of the comments ;-) */ -- cgit v1.2.3 From a98934adc9277d1dea52b929d59c6b15ccf115a2 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Thu, 2 Jul 2009 11:02:13 +0200 Subject: sh: add cacheflush syscall wrapper Signed-off-by: Giuseppe Cavallaro Signed-off-by: Carmelo Amoroso --- libc/sysdeps/linux/sh/Makefile.arch | 2 +- libc/sysdeps/linux/sh/cacheflush.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 libc/sysdeps/linux/sh/cacheflush.c (limited to 'libc') diff --git a/libc/sysdeps/linux/sh/Makefile.arch b/libc/sysdeps/linux/sh/Makefile.arch index 77ad570d6..2c69f59b8 100644 --- a/libc/sysdeps/linux/sh/Makefile.arch +++ b/libc/sysdeps/linux/sh/Makefile.arch @@ -7,7 +7,7 @@ # CSRC := \ - mmap.c pipe.c __init_brk.c brk.c sbrk.c syscall.c pread_write.c + mmap.c pipe.c __init_brk.c brk.c sbrk.c syscall.c pread_write.c cacheflush.c SSRC := setjmp.S __longjmp.S vfork.S clone.S ___fpscr_values.S diff --git a/libc/sysdeps/linux/sh/cacheflush.c b/libc/sysdeps/linux/sh/cacheflush.c new file mode 100644 index 000000000..58229186d --- /dev/null +++ b/libc/sysdeps/linux/sh/cacheflush.c @@ -0,0 +1,15 @@ +/* + * cacheflush syscall for SUPERH + * + * Copyright (C) 2009 STMicroelectronics Ltd + * Author: Giuseppe Cavallaro + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ +#include +#include +#include + +#ifdef __NR_cacheflush +_syscall3(int, cacheflush, char *, addr, int, nbytes, int, op) +#endif -- cgit v1.2.3