From 7e51a684c591db163a3944de55848dc642643b6c Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 12 Nov 2005 01:03:51 +0000 Subject: Add hidden versions --- libc/string/x86_64/memcpy.S | 7 +++++-- libc/string/x86_64/memset.S | 7 +++++-- libc/string/x86_64/strcat.S | 7 +++++-- libc/string/x86_64/strchr.S | 7 +++++-- libc/string/x86_64/strcmp.S | 7 +++++-- libc/string/x86_64/strcpy.S | 5 ++++- libc/string/x86_64/strcspn.S | 12 +++++++++--- libc/string/x86_64/strlen.S | 7 +++++-- libc/string/x86_64/strpbrk.S | 5 ++++- libc/string/x86_64/strspn.S | 7 +++++-- 10 files changed, 52 insertions(+), 19 deletions(-) (limited to 'libc/string/x86_64') diff --git a/libc/string/x86_64/memcpy.S b/libc/string/x86_64/memcpy.S index 4fa38a640..c375bf3fb 100644 --- a/libc/string/x86_64/memcpy.S +++ b/libc/string/x86_64/memcpy.S @@ -32,7 +32,10 @@ ENTRY (__memcpy_chk) jb HIDDEN_JUMPTARGET (__chk_fail) END (__memcpy_chk) #endif -ENTRY (BP_SYM (memcpy)) +.global memcpy +.set memcpy,__memcpy +.hidden __memcpy +ENTRY (BP_SYM (__memcpy)) /* Cutoff for the big loop is a size of 32 bytes since otherwise the loop will never be entered. */ cmpq $32, %rdx @@ -92,4 +95,4 @@ ENTRY (BP_SYM (memcpy)) #endif ret -END (BP_SYM (memcpy)) +END (BP_SYM (__memcpy)) diff --git a/libc/string/x86_64/memset.S b/libc/string/x86_64/memset.S index d74ec8ccb..d66195580 100644 --- a/libc/string/x86_64/memset.S +++ b/libc/string/x86_64/memset.S @@ -35,7 +35,10 @@ ENTRY (__memset_chk) jb HIDDEN_JUMPTARGET (__chk_fail) END (__memset_chk) #endif -ENTRY (memset) +.global memset +.set memset,__memset +.hidden __memset +ENTRY (__memset) #if BZERO_P mov %rsi,%rdx /* Adjust parameter. */ xorl %esi,%esi /* Fill with 0s. */ @@ -131,7 +134,7 @@ ENTRY (memset) jne 11b jmp 4b -END (memset) +END (__memset) #if !BZERO_P && defined PIC && !defined NOT_IN_libc strong_alias (__memset_chk, __memset_zero_constant_len_parameter) diff --git a/libc/string/x86_64/strcat.S b/libc/string/x86_64/strcat.S index 1106cb4ed..9ee10b202 100644 --- a/libc/string/x86_64/strcat.S +++ b/libc/string/x86_64/strcat.S @@ -23,7 +23,10 @@ .text -ENTRY (BP_SYM (strcat)) +.global strcat +.set strcat,__strcat +.hidden __strcat +ENTRY (BP_SYM (__strcat)) movq %rdi, %rcx /* Dest. register. */ andl $7, %ecx /* mask alignment bits */ movq %rdi, %rax /* Duplicate destination pointer. */ @@ -253,4 +256,4 @@ ENTRY (BP_SYM (strcat)) 24: movq %rdi, %rax /* Source is return value. */ retq -END (BP_SYM (strcat)) +END (BP_SYM (__strcat)) diff --git a/libc/string/x86_64/strchr.S b/libc/string/x86_64/strchr.S index b84b012b2..04d365a82 100644 --- a/libc/string/x86_64/strchr.S +++ b/libc/string/x86_64/strchr.S @@ -22,7 +22,10 @@ .text -ENTRY (BP_SYM (strchr)) +.globl strchr +.set strchr,__strchr +.hidden __strchr +ENTRY (BP_SYM (__strchr)) /* Before we start with the main loop we process single bytes until the source pointer is aligned. This has two reasons: @@ -282,6 +285,6 @@ ENTRY (BP_SYM (strchr)) 6: nop retq -END (BP_SYM (strchr)) +END (BP_SYM (__strchr)) weak_alias (BP_SYM (strchr), BP_SYM (index)) diff --git a/libc/string/x86_64/strcmp.S b/libc/string/x86_64/strcmp.S index 0b401a773..f933c1156 100644 --- a/libc/string/x86_64/strcmp.S +++ b/libc/string/x86_64/strcmp.S @@ -22,7 +22,10 @@ #include "_glibc_inc.h" .text -ENTRY (BP_SYM (strcmp)) +.global strcmp +.set strcmp,__strcmp +.hidden __strcmp +ENTRY (BP_SYM (__strcmp)) L(oop): movb (%rdi), %al cmpb (%rsi), %al jne L(neq) @@ -38,4 +41,4 @@ L(neq): movl $1, %eax movl $-1, %ecx cmovbl %ecx, %eax ret -END (BP_SYM (strcmp)) +END (BP_SYM (__strcmp)) diff --git a/libc/string/x86_64/strcpy.S b/libc/string/x86_64/strcpy.S index 0847e2b7c..1a64d2745 100644 --- a/libc/string/x86_64/strcpy.S +++ b/libc/string/x86_64/strcpy.S @@ -21,7 +21,10 @@ #include "_glibc_inc.h" #ifndef USE_AS_STPCPY -# define STRCPY strcpy +# define STRCPY __strcpy +.global strcpy +.set strcpy,__strcpy +.hidden __strcpy #endif .text diff --git a/libc/string/x86_64/strcspn.S b/libc/string/x86_64/strcspn.S index e1a22e4f1..e25100bc1 100644 --- a/libc/string/x86_64/strcspn.S +++ b/libc/string/x86_64/strcspn.S @@ -26,10 +26,16 @@ #include "_glibc_inc.h" /* BEWARE: `#ifdef strcspn' means that strcspn is redefined as `strpbrk' */ -#define STRPBRK_P (defined strcspn) +#define STRPBRK_P (defined __strcspn) .text -ENTRY (strcspn) +#if STRPBRK_P +#else +.global strcspn +.set strcspn,__strcspn +.hidden __strcspn +#endif +ENTRY (__strcspn) movq %rdi, %rdx /* Save SRC. */ @@ -120,4 +126,4 @@ L(4): addq $256, %rsp /* remove skipset */ non-valid character */ #endif ret -END (strcspn) +END (__strcspn) diff --git a/libc/string/x86_64/strlen.S b/libc/string/x86_64/strlen.S index 36b63031e..ab25515f8 100644 --- a/libc/string/x86_64/strlen.S +++ b/libc/string/x86_64/strlen.S @@ -22,7 +22,10 @@ .text -ENTRY (strlen) +.global strlen +.set strlen,__strlen +.hidden __strlen +ENTRY (__strlen) movq %rdi, %rcx /* Duplicate source pointer. */ andl $7, %ecx /* mask alignment bits */ movq %rdi, %rax /* duplicate destination. */ @@ -132,4 +135,4 @@ ENTRY (strlen) 2: subq %rdi, %rax /* compute difference to string start */ ret -END (strlen) +END (__strlen) diff --git a/libc/string/x86_64/strpbrk.S b/libc/string/x86_64/strpbrk.S index c49cd2c06..c37befe72 100644 --- a/libc/string/x86_64/strpbrk.S +++ b/libc/string/x86_64/strpbrk.S @@ -1,2 +1,5 @@ -#define strcspn strpbrk +#define __strcspn __strpbrk +.global strpbrk +.set strpbrk,__strpbrk +.hidden __strpbrk #include "strcspn.S" diff --git a/libc/string/x86_64/strspn.S b/libc/string/x86_64/strspn.S index 245d8e699..8d5903c1b 100644 --- a/libc/string/x86_64/strspn.S +++ b/libc/string/x86_64/strspn.S @@ -26,7 +26,10 @@ #include "_glibc_inc.h" .text -ENTRY (strspn) +.global strspn +.set strspn,__strspn +.hidden __strspn +ENTRY (__strspn) movq %rdi, %rdx /* Save SRC. */ @@ -111,4 +114,4 @@ L(4): addq $256, %rsp /* remove stopset */ characters, so compute distance to first non-valid character */ ret -END (strspn) +END (__strspn) -- cgit v1.2.3