svn commit: trunk/uClibc/libc/string: bfin generic

vapier at uclibc.org vapier at uclibc.org
Sat Dec 22 06:28:24 UTC 2007


Author: vapier
Date: 2007-12-21 22:28:23 -0800 (Fri, 21 Dec 2007)
New Revision: 20664

Log:
mark a bunch of public mem/str functions as weak so that people who insist on their own local copies while static linking dont hit link failures when other uClibc code force the libc.a objects to be pulled in via the hidden alias symbols

Modified:
   trunk/uClibc/libc/string/bfin/memchr.S
   trunk/uClibc/libc/string/bfin/memcmp.S
   trunk/uClibc/libc/string/bfin/memcpy.S
   trunk/uClibc/libc/string/bfin/memmove.S
   trunk/uClibc/libc/string/bfin/memset.S
   trunk/uClibc/libc/string/bfin/strcmp.S
   trunk/uClibc/libc/string/generic/memchr.c
   trunk/uClibc/libc/string/generic/memcmp.c
   trunk/uClibc/libc/string/generic/memcpy.c
   trunk/uClibc/libc/string/generic/memmove.c
   trunk/uClibc/libc/string/generic/mempcpy.c
   trunk/uClibc/libc/string/generic/memset.c
   trunk/uClibc/libc/string/generic/strchr.c
   trunk/uClibc/libc/string/generic/strcmp.c
   trunk/uClibc/libc/string/generic/strlen.c
   trunk/uClibc/libc/string/generic/strrchr.c
   trunk/uClibc/libc/string/mempcpy.c
   trunk/uClibc/libc/string/strchr.c
   trunk/uClibc/libc/string/strdup.c
   trunk/uClibc/libc/string/strlen.c
   trunk/uClibc/libc/string/strrchr.c


Changeset:
Modified: trunk/uClibc/libc/string/bfin/memchr.S
===================================================================
--- trunk/uClibc/libc/string/bfin/memchr.S	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/bfin/memchr.S	2007-12-22 06:28:23 UTC (rev 20664)
@@ -23,6 +23,7 @@
 
 .align 2
 
+.weak _memchr
 ENTRY(_memchr)
 	P0 = R0;             // P0 = address
 	P2 = R2;             // P2 = count

Modified: trunk/uClibc/libc/string/bfin/memcmp.S
===================================================================
--- trunk/uClibc/libc/string/bfin/memcmp.S	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/bfin/memcmp.S	2007-12-22 06:28:23 UTC (rev 20664)
@@ -23,6 +23,7 @@
 
 .align 2
 
+.weak _memcmp
 ENTRY(_memcmp)
 	I1 = P3;
 	P0 = R0;			/* P0 = s1 address */
@@ -99,5 +100,5 @@
 libc_hidden_def (memcmp)
 
 #ifdef __UCLIBC_SUSV3_LEGACY__
-strong_alias (memcmp,bcmp)
+weak_alias (memcmp,bcmp)
 #endif

Modified: trunk/uClibc/libc/string/bfin/memcpy.S
===================================================================
--- trunk/uClibc/libc/string/bfin/memcpy.S	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/bfin/memcpy.S	2007-12-22 06:28:23 UTC (rev 20664)
@@ -23,12 +23,8 @@
 
 .align 2
 
-/* We have to bypass the libc-symbols.h machinery to make sure we get
- * a weak symbol for memcpy (some crummy gcc tests want to redefine it).
- */
-.global ___GI_memcpy
-.type ___GI_memcpy, STT_FUNC
-___GI_memcpy:
+.weak _memcpy
+ENTRY(_memcpy)
 	[--SP] = P3;
 	P0 = R0;              /* P0 = To address */
 	P3 = R1;              /* P3 = From Address */
@@ -75,8 +71,7 @@
 	P3 = [SP++];
 
 	RTS;
-.size ___GI_memcpy,.-___GI_memcpy
 
-.hidden ___GI_memcpy
-.weak _memcpy
-.set _memcpy,___GI_memcpy
+.size _memcpy,.-_memcpy
+
+libc_hidden_def (memcpy)

Modified: trunk/uClibc/libc/string/bfin/memmove.S
===================================================================
--- trunk/uClibc/libc/string/bfin/memmove.S	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/bfin/memmove.S	2007-12-22 06:28:23 UTC (rev 20664)
@@ -23,12 +23,8 @@
 
 .align 2
 
-	/* We have to bypass the libc-symbols.h machinery to make sure we get
-	   a weak symbol for memcpy (some crummy gcc tests want to redefine
-	   it).  */
-.global ___GI_memmove
-.type ___GI_memmove, STT_FUNC
-___GI_memmove:
+.weak _memmove
+ENTRY(_memmove)
 	I1 = P3;
 	P0 = R0;                  /* P0 = To address */
 	P3 = R1;                  /* P3 = From Address */
@@ -99,8 +95,6 @@
 	P3 = I1;
 	RTS;
 
-.size ___GI_memmove,.-___GI_memmove
+.size _memmove,.-_memmove
 
-.hidden ___GI_memmove
-.weak _memmove
-.set _memmove,___GI_memmove
+libc_hidden_def (memmove)

Modified: trunk/uClibc/libc/string/bfin/memset.S
===================================================================
--- trunk/uClibc/libc/string/bfin/memset.S	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/bfin/memset.S	2007-12-22 06:28:23 UTC (rev 20664)
@@ -23,12 +23,8 @@
 
 .align 2
 
-/* We have to bypass the libc-symbols.h machinery to make sure we get
- * a weak symbol for memcpy (some crummy gcc tests want to redefine it).
- */
-.global ___GI_memset
-.type ___GI_memset, STT_FUNC
-___GI_memset:
+.weak _memset
+ENTRY(_memset)
 	P0 = R0 ;              /* P0 = address */
 	P2 = R2 ;              /* P2 = count   */
 	R3 = R0 + R2;          /* end          */
@@ -89,8 +85,6 @@
 	B[P0++] = R1;
 	JUMP .Laligned;
 
-.size ___GI_memset,.-___GI_memset
+.size _memset,.-_memset
 
-.hidden ___GI_memset
-.weak _memset
-.set _memset,___GI_memset
+libc_hidden_def (memset)

Modified: trunk/uClibc/libc/string/bfin/strcmp.S
===================================================================
--- trunk/uClibc/libc/string/bfin/strcmp.S	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/bfin/strcmp.S	2007-12-22 06:28:23 UTC (rev 20664)
@@ -23,6 +23,7 @@
 
 .align 2
 
+.weak _strcmp
 ENTRY(_strcmp)
 	[--sp] = (R7:4);
 	p1 = r0;
@@ -116,6 +117,6 @@
 libc_hidden_def (strcmp)
 
 #ifndef __UCLIBC_HAS_LOCALE__
-strong_alias (strcmp,strcoll)
+weak_alias (strcmp,strcoll)
 libc_hidden_def (strcoll)
 #endif

Modified: trunk/uClibc/libc/string/generic/memchr.c
===================================================================
--- trunk/uClibc/libc/string/generic/memchr.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/generic/memchr.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -174,4 +174,4 @@
 
   return 0;
 }
-libc_hidden_def(memchr)
+libc_hidden_weak(memchr)

Modified: trunk/uClibc/libc/string/generic/memcmp.c
===================================================================
--- trunk/uClibc/libc/string/generic/memcmp.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/generic/memcmp.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -330,7 +330,7 @@
 
   return 0;
 }
-libc_hidden_def(memcmp)
+libc_hidden_weak(memcmp)
 #ifdef __UCLIBC_SUSV3_LEGACY__
 strong_alias(memcmp,bcmp)
 #endif

Modified: trunk/uClibc/libc/string/generic/memcpy.c
===================================================================
--- trunk/uClibc/libc/string/generic/memcpy.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/generic/memcpy.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -244,4 +244,4 @@
 
   return dstpp;
 }
-libc_hidden_def(memcpy)
+libc_hidden_weak(memcpy)

Modified: trunk/uClibc/libc/string/generic/memmove.c
===================================================================
--- trunk/uClibc/libc/string/generic/memmove.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/generic/memmove.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -279,4 +279,4 @@
 
   return (dest);
 }
-libc_hidden_def(memmove)
+libc_hidden_weak(memmove)

Modified: trunk/uClibc/libc/string/generic/mempcpy.c
===================================================================
--- trunk/uClibc/libc/string/generic/mempcpy.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/generic/mempcpy.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -16,5 +16,5 @@
   memcpy(dstpp, srcpp, len);
   return (void *)(((char *)dstpp) + len);
 }
-libc_hidden_def(mempcpy)
+libc_hidden_weak(mempcpy)
 #endif

Modified: trunk/uClibc/libc/string/generic/memset.c
===================================================================
--- trunk/uClibc/libc/string/generic/memset.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/generic/memset.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -83,4 +83,4 @@
 
   return dstpp;
 }
-libc_hidden_def(memset)
+libc_hidden_weak(memset)

Modified: trunk/uClibc/libc/string/generic/strchr.c
===================================================================
--- trunk/uClibc/libc/string/generic/strchr.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/generic/strchr.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -181,7 +181,7 @@
 
   return NULL;
 }
-libc_hidden_def(strchr)
+libc_hidden_weak(strchr)
 #ifdef __UCLIBC_SUSV3_LEGACY__
-strong_alias(strchr,index)
+weak_alias(strchr,index)
 #endif

Modified: trunk/uClibc/libc/string/generic/strcmp.c
===================================================================
--- trunk/uClibc/libc/string/generic/strcmp.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/generic/strcmp.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -41,7 +41,7 @@
 
   return c1 - c2;
 }
-libc_hidden_def(strcmp)
+libc_hidden_weak(strcmp)
 
 #ifndef __UCLIBC_HAS_LOCALE__
 libc_hidden_proto(strcoll)

Modified: trunk/uClibc/libc/string/generic/strlen.c
===================================================================
--- trunk/uClibc/libc/string/generic/strlen.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/generic/strlen.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -149,4 +149,4 @@
 	}
     }
 }
-libc_hidden_def(strlen)
+libc_hidden_weak(strlen)

Modified: trunk/uClibc/libc/string/generic/strrchr.c
===================================================================
--- trunk/uClibc/libc/string/generic/strrchr.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/generic/strrchr.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -42,7 +42,7 @@
 
   return (char *) found;
 }
-libc_hidden_def(strrchr)
+libc_hidden_weak(strrchr)
 #ifdef __UCLIBC_SUSV3_LEGACY__
-strong_alias(strrchr,rindex)
+weak_alias(strrchr,rindex)
 #endif

Modified: trunk/uClibc/libc/string/mempcpy.c
===================================================================
--- trunk/uClibc/libc/string/mempcpy.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/mempcpy.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -36,5 +36,5 @@
 	return r1;
 }
 
-libc_hidden_def(Wmempcpy)
+libc_hidden_weak(Wmempcpy)
 #endif

Modified: trunk/uClibc/libc/string/strchr.c
===================================================================
--- trunk/uClibc/libc/string/strchr.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/strchr.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -28,5 +28,5 @@
 libc_hidden_def(Wstrchr)
 
 #if !defined WANT_WIDE && defined __UCLIBC_SUSV3_LEGACY__
-strong_alias(strchr,index)
+weak_alias(strchr,index)
 #endif

Modified: trunk/uClibc/libc/string/strdup.c
===================================================================
--- trunk/uClibc/libc/string/strdup.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/strdup.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -33,5 +33,5 @@
 }
 
 #ifndef WANT_WIDE
-libc_hidden_def(strdup)
+libc_hidden_weak(strdup)
 #endif

Modified: trunk/uClibc/libc/string/strlen.c
===================================================================
--- trunk/uClibc/libc/string/strlen.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/strlen.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -23,4 +23,4 @@
 
 	return p - s;
 }
-libc_hidden_def(Wstrlen)
+libc_hidden_weak(Wstrlen)

Modified: trunk/uClibc/libc/string/strrchr.c
===================================================================
--- trunk/uClibc/libc/string/strrchr.c	2007-12-22 06:23:15 UTC (rev 20663)
+++ trunk/uClibc/libc/string/strrchr.c	2007-12-22 06:28:23 UTC (rev 20664)
@@ -28,8 +28,8 @@
 	return (Wchar *) p;			/* silence the warning */
 }
 #ifndef WANT_WIDE
-libc_hidden_def(strrchr)
+libc_hidden_weak(strrchr)
 # ifdef __UCLIBC_SUSV3_LEGACY__
-strong_alias(strrchr,rindex)
+weak_alias(strrchr,rindex)
 # endif
 #endif




More information about the uClibc-cvs mailing list