From fe68563b9a070fedf117c8738652587945427bb3 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Tue, 3 Jan 2006 14:46:56 +0000 Subject: Use strong_alias everywhere instead of .global/.set. Correct some cases where the non-hidden version was used. --- libc/string/x86_64/_glibc_inc.h | 6 +----- libc/string/x86_64/bzero.S | 4 ++-- libc/string/x86_64/memcpy.S | 8 ++++---- libc/string/x86_64/mempcpy.S | 3 +++ libc/string/x86_64/memset.S | 8 ++++---- libc/string/x86_64/stpcpy.S | 4 +--- libc/string/x86_64/strcat.S | 5 ++--- libc/string/x86_64/strchr.S | 6 ++---- libc/string/x86_64/strcmp.S | 5 ++--- libc/string/x86_64/strcpy.S | 6 +++--- libc/string/x86_64/strcspn.S | 10 ++++------ libc/string/x86_64/strlen.S | 5 ++--- libc/string/x86_64/strpbrk.S | 4 +--- libc/string/x86_64/strspn.S | 5 ++--- 14 files changed, 33 insertions(+), 46 deletions(-) create mode 100644 libc/string/x86_64/mempcpy.S (limited to 'libc/string/x86_64') diff --git a/libc/string/x86_64/_glibc_inc.h b/libc/string/x86_64/_glibc_inc.h index f14b23c94..3c31957db 100644 --- a/libc/string/x86_64/_glibc_inc.h +++ b/libc/string/x86_64/_glibc_inc.h @@ -14,6 +14,7 @@ #define ENTRY(sym) \ .global sym; \ + .hidden sym; \ .align ENTRY_ALIGN; \ .type sym,%function; \ sym: @@ -26,8 +27,3 @@ #define END(sym) \ .size sym,.-sym; - -#undef weak_alias -#define weak_alias(sym, alias) \ - .weak alias; \ - alias = sym; diff --git a/libc/string/x86_64/bzero.S b/libc/string/x86_64/bzero.S index abd252e7b..73ba75436 100644 --- a/libc/string/x86_64/bzero.S +++ b/libc/string/x86_64/bzero.S @@ -1,3 +1,3 @@ -#define memset __bzero +#define __memset __bzero #include "memset.S" -weak_alias (__bzero, bzero) +strong_alias(__bzero,bzero) diff --git a/libc/string/x86_64/memcpy.S b/libc/string/x86_64/memcpy.S index c375bf3fb..973cd513f 100644 --- a/libc/string/x86_64/memcpy.S +++ b/libc/string/x86_64/memcpy.S @@ -23,7 +23,7 @@ /* BEWARE: `#ifdef memcpy' means that memcpy is redefined as `mempcpy', and the return value is the byte after the last one copied in the destination. */ -#define MEMPCPY_P (defined memcpy) +#define MEMPCPY_P (defined __memcpy) .text #if defined PIC && !defined NOT_IN_libc @@ -32,9 +32,6 @@ ENTRY (__memcpy_chk) jb HIDDEN_JUMPTARGET (__chk_fail) END (__memcpy_chk) #endif -.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. */ @@ -96,3 +93,6 @@ ENTRY (BP_SYM (__memcpy)) ret END (BP_SYM (__memcpy)) +#if !MEMPCPY_P +strong_alias(__memcpy,memcpy) +#endif diff --git a/libc/string/x86_64/mempcpy.S b/libc/string/x86_64/mempcpy.S new file mode 100644 index 000000000..3a8e925fd --- /dev/null +++ b/libc/string/x86_64/mempcpy.S @@ -0,0 +1,3 @@ +#define __memcpy __mempcpy +#include "memcpy.S" +strong_alias(__mempcpy,mempcpy) diff --git a/libc/string/x86_64/memset.S b/libc/string/x86_64/memset.S index d66195580..923e1c208 100644 --- a/libc/string/x86_64/memset.S +++ b/libc/string/x86_64/memset.S @@ -22,7 +22,7 @@ #include "_glibc_inc.h" /* BEWARE: `#ifdef memset' means that memset is redefined as `bzero' */ -#define BZERO_P (defined memset) +#define BZERO_P (defined __memset) /* This is somehow experimental and could made dependend on the cache size. */ @@ -35,9 +35,6 @@ ENTRY (__memset_chk) jb HIDDEN_JUMPTARGET (__chk_fail) END (__memset_chk) #endif -.global memset -.set memset,__memset -.hidden __memset ENTRY (__memset) #if BZERO_P mov %rsi,%rdx /* Adjust parameter. */ @@ -135,6 +132,9 @@ ENTRY (__memset) jmp 4b END (__memset) +#if !BZERO_P +strong_alias(__memset,memset) +#endif #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/stpcpy.S b/libc/string/x86_64/stpcpy.S index 83294e1a8..075773371 100644 --- a/libc/string/x86_64/stpcpy.S +++ b/libc/string/x86_64/stpcpy.S @@ -1,6 +1,4 @@ #define USE_AS_STPCPY #define STRCPY __stpcpy - #include "strcpy.S" - -weak_alias (__stpcpy, stpcpy) +strong_alias(__stpcpy,stpcpy) diff --git a/libc/string/x86_64/strcat.S b/libc/string/x86_64/strcat.S index 9ee10b202..6c7189a21 100644 --- a/libc/string/x86_64/strcat.S +++ b/libc/string/x86_64/strcat.S @@ -23,9 +23,6 @@ .text -.global strcat -.set strcat,__strcat -.hidden __strcat ENTRY (BP_SYM (__strcat)) movq %rdi, %rcx /* Dest. register. */ andl $7, %ecx /* mask alignment bits */ @@ -257,3 +254,5 @@ ENTRY (BP_SYM (__strcat)) movq %rdi, %rax /* Source is return value. */ retq END (BP_SYM (__strcat)) + +strong_alias(__strcat,strcat) diff --git a/libc/string/x86_64/strchr.S b/libc/string/x86_64/strchr.S index 04d365a82..312d62b61 100644 --- a/libc/string/x86_64/strchr.S +++ b/libc/string/x86_64/strchr.S @@ -22,9 +22,6 @@ .text -.globl strchr -.set strchr,__strchr -.hidden __strchr ENTRY (BP_SYM (__strchr)) /* Before we start with the main loop we process single bytes @@ -287,4 +284,5 @@ ENTRY (BP_SYM (__strchr)) retq END (BP_SYM (__strchr)) -weak_alias (BP_SYM (strchr), BP_SYM (index)) +strong_alias(__strchr,strchr) +strong_alias (BP_SYM (__strchr), BP_SYM (index)) diff --git a/libc/string/x86_64/strcmp.S b/libc/string/x86_64/strcmp.S index f933c1156..1eaff1691 100644 --- a/libc/string/x86_64/strcmp.S +++ b/libc/string/x86_64/strcmp.S @@ -22,9 +22,6 @@ #include "_glibc_inc.h" .text -.global strcmp -.set strcmp,__strcmp -.hidden __strcmp ENTRY (BP_SYM (__strcmp)) L(oop): movb (%rdi), %al cmpb (%rsi), %al @@ -42,3 +39,5 @@ L(neq): movl $1, %eax cmovbl %ecx, %eax ret END (BP_SYM (__strcmp)) + +strong_alias(__strcmp,strcmp) diff --git a/libc/string/x86_64/strcpy.S b/libc/string/x86_64/strcpy.S index 1a64d2745..0bd2a6471 100644 --- a/libc/string/x86_64/strcpy.S +++ b/libc/string/x86_64/strcpy.S @@ -22,9 +22,6 @@ #ifndef USE_AS_STPCPY # define STRCPY __strcpy -.global strcpy -.set strcpy,__strcpy -.hidden __strcpy #endif .text @@ -154,3 +151,6 @@ ENTRY (BP_SYM (STRCPY)) #endif retq END (BP_SYM (STRCPY)) +#ifndef USE_AS_STPCPY +strong_alias(__strcpy,strcpy) +#endif diff --git a/libc/string/x86_64/strcspn.S b/libc/string/x86_64/strcspn.S index e25100bc1..35959e500 100644 --- a/libc/string/x86_64/strcspn.S +++ b/libc/string/x86_64/strcspn.S @@ -29,12 +29,6 @@ #define STRPBRK_P (defined __strcspn) .text -#if STRPBRK_P -#else -.global strcspn -.set strcspn,__strcspn -.hidden __strcspn -#endif ENTRY (__strcspn) movq %rdi, %rdx /* Save SRC. */ @@ -127,3 +121,7 @@ L(4): addq $256, %rsp /* remove skipset */ #endif ret END (__strcspn) + +#if !STRPBRK_P +strong_alias(__strcspn,strcspn) +#endif diff --git a/libc/string/x86_64/strlen.S b/libc/string/x86_64/strlen.S index ab25515f8..77aae71ba 100644 --- a/libc/string/x86_64/strlen.S +++ b/libc/string/x86_64/strlen.S @@ -22,9 +22,6 @@ .text -.global strlen -.set strlen,__strlen -.hidden __strlen ENTRY (__strlen) movq %rdi, %rcx /* Duplicate source pointer. */ andl $7, %ecx /* mask alignment bits */ @@ -136,3 +133,5 @@ ENTRY (__strlen) subq %rdi, %rax /* compute difference to string start */ ret END (__strlen) + +strong_alias(__strlen,strlen) diff --git a/libc/string/x86_64/strpbrk.S b/libc/string/x86_64/strpbrk.S index c37befe72..94b14d091 100644 --- a/libc/string/x86_64/strpbrk.S +++ b/libc/string/x86_64/strpbrk.S @@ -1,5 +1,3 @@ #define __strcspn __strpbrk -.global strpbrk -.set strpbrk,__strpbrk -.hidden __strpbrk #include "strcspn.S" +strong_alias(__strpbrk,strpbrk) diff --git a/libc/string/x86_64/strspn.S b/libc/string/x86_64/strspn.S index 8d5903c1b..ae5b4a1df 100644 --- a/libc/string/x86_64/strspn.S +++ b/libc/string/x86_64/strspn.S @@ -26,9 +26,6 @@ #include "_glibc_inc.h" .text -.global strspn -.set strspn,__strspn -.hidden __strspn ENTRY (__strspn) movq %rdi, %rdx /* Save SRC. */ @@ -115,3 +112,5 @@ L(4): addq $256, %rsp /* remove stopset */ non-valid character */ ret END (__strspn) + +strong_alias(__strspn,strspn) -- cgit v1.2.3