From e11c3011b10ada67c68d2d43a56fe606d35ca507 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 22 Dec 2007 06:28:23 +0000 Subject: 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 --- libc/string/bfin/memchr.S | 1 + libc/string/bfin/memcmp.S | 3 ++- libc/string/bfin/memcpy.S | 15 +++++---------- libc/string/bfin/memmove.S | 14 ++++---------- libc/string/bfin/memset.S | 14 ++++---------- libc/string/bfin/strcmp.S | 3 ++- 6 files changed, 18 insertions(+), 32 deletions(-) (limited to 'libc/string/bfin') diff --git a/libc/string/bfin/memchr.S b/libc/string/bfin/memchr.S index c264ad3d1..88e46bef6 100644 --- a/libc/string/bfin/memchr.S +++ b/libc/string/bfin/memchr.S @@ -23,6 +23,7 @@ .align 2 +.weak _memchr ENTRY(_memchr) P0 = R0; // P0 = address P2 = R2; // P2 = count diff --git a/libc/string/bfin/memcmp.S b/libc/string/bfin/memcmp.S index b5d4f1c7a..7cc76ad96 100644 --- a/libc/string/bfin/memcmp.S +++ b/libc/string/bfin/memcmp.S @@ -23,6 +23,7 @@ .align 2 +.weak _memcmp ENTRY(_memcmp) I1 = P3; P0 = R0; /* P0 = s1 address */ @@ -99,5 +100,5 @@ ENTRY(_memcmp) libc_hidden_def (memcmp) #ifdef __UCLIBC_SUSV3_LEGACY__ -strong_alias (memcmp,bcmp) +weak_alias (memcmp,bcmp) #endif diff --git a/libc/string/bfin/memcpy.S b/libc/string/bfin/memcpy.S index ae40cb244..bdd760691 100644 --- a/libc/string/bfin/memcpy.S +++ b/libc/string/bfin/memcpy.S @@ -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 @@ ___GI_memcpy: P3 = [SP++]; RTS; -.size ___GI_memcpy,.-___GI_memcpy -.hidden ___GI_memcpy -.weak _memcpy -.set _memcpy,___GI_memcpy +.size _memcpy,.-_memcpy + +libc_hidden_def (memcpy) diff --git a/libc/string/bfin/memmove.S b/libc/string/bfin/memmove.S index da1128387..73e363820 100644 --- a/libc/string/bfin/memmove.S +++ b/libc/string/bfin/memmove.S @@ -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 @@ ___GI_memmove: P3 = I1; RTS; -.size ___GI_memmove,.-___GI_memmove +.size _memmove,.-_memmove -.hidden ___GI_memmove -.weak _memmove -.set _memmove,___GI_memmove +libc_hidden_def (memmove) diff --git a/libc/string/bfin/memset.S b/libc/string/bfin/memset.S index c8ee0835f..64012f783 100644 --- a/libc/string/bfin/memset.S +++ b/libc/string/bfin/memset.S @@ -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 @@ ___GI_memset: 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) diff --git a/libc/string/bfin/strcmp.S b/libc/string/bfin/strcmp.S index c0a706d2b..12e8c53c6 100644 --- a/libc/string/bfin/strcmp.S +++ b/libc/string/bfin/strcmp.S @@ -23,6 +23,7 @@ .align 2 +.weak _strcmp ENTRY(_strcmp) [--sp] = (R7:4); p1 = r0; @@ -116,6 +117,6 @@ ENTRY(_strcmp) libc_hidden_def (strcmp) #ifndef __UCLIBC_HAS_LOCALE__ -strong_alias (strcmp,strcoll) +weak_alias (strcmp,strcoll) libc_hidden_def (strcoll) #endif -- cgit v1.2.3