For all i386 string assembly functions that don't overlap use END() so

that symbol size information is available.
This commit is contained in:
jakllsch 2014-03-22 19:38:46 +00:00
parent 6ac3c1f4d7
commit 2c56941e16
16 changed files with 51 additions and 26 deletions

View File

@ -6,7 +6,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: ffs.S,v 1.1 2005/12/20 19:28:49 christos Exp $")
RCSID("$NetBSD: ffs.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
#endif
ENTRY(ffs)
@ -18,3 +18,4 @@ ENTRY(ffs)
_ALIGN_TEXT
L1: xorl %eax,%eax /* clear result */
ret
END(ffs)

View File

@ -6,7 +6,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: memchr.S,v 1.1 2005/12/20 19:28:49 christos Exp $")
RCSID("$NetBSD: memchr.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
#endif
ENTRY(memchr)
@ -16,7 +16,7 @@ ENTRY(memchr)
movl 16(%esp),%esi
/*
* Align to word boundary.
* Align to word boundary.
* Consider unrolling loop?
*/
testl %esi,%esi /* nbytes == 0? */
@ -107,3 +107,4 @@ ENTRY(memchr)
.Ldone:
popl %esi
ret
END(memchr)

View File

@ -6,7 +6,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: memcmp.S,v 1.2 2007/11/12 18:41:59 ad Exp $")
RCSID("$NetBSD: memcmp.S,v 1.3 2014/03/22 19:38:46 jakllsch Exp $")
#endif
ENTRY(memcmp)
@ -45,3 +45,4 @@ L6: xorl %eax,%eax /* Perform unsigned comparison */
popl %esi
popl %edi
ret
END(memcmp)

View File

@ -1,4 +1,4 @@
/* $NetBSD: memcpy.S,v 1.3 2007/11/12 18:41:59 ad Exp $ */
/* $NetBSD: memcpy.S,v 1.4 2014/03/22 19:38:46 jakllsch Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -35,7 +35,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: memcpy.S,v 1.3 2007/11/12 18:41:59 ad Exp $")
RCSID("$NetBSD: memcpy.S,v 1.4 2014/03/22 19:38:46 jakllsch Exp $")
#endif
/*
@ -131,3 +131,13 @@ ENTRY(memcpy)
movb %al,(%edi)
jmp .Lback_aligned
#endif
#ifdef BCOPY
END(bcopy)
#else
#ifdef MEMMOVE
END(memmove)
#else
END(memcpy)
#endif
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: memcmp.S,v 1.1 2011/06/16 16:39:14 joerg Exp $ */
/* $NetBSD: memcmp.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@ -29,7 +29,7 @@
*/
#include <machine/asm.h>
RCSID("$NetBSD: memcmp.S,v 1.1 2011/06/16 16:39:14 joerg Exp $")
RCSID("$NetBSD: memcmp.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
ENTRY(memcmp)
pushl %esi
@ -48,3 +48,4 @@ ENTRY(memcmp)
1:
decl %eax
ret
END(memcmp)

View File

@ -1,4 +1,4 @@
/* $NetBSD: memset.S,v 1.1 2011/06/16 16:39:14 joerg Exp $ */
/* $NetBSD: memset.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <machine/asm.h>
RCSID("$NetBSD: memset.S,v 1.1 2011/06/16 16:39:14 joerg Exp $")
RCSID("$NetBSD: memset.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
ENTRY(memset)
pushl %edi
@ -43,3 +43,4 @@ ENTRY(memset)
popl %eax
popl %edi
ret
END(memset)

View File

@ -1,4 +1,4 @@
/* $NetBSD: strchr.S,v 1.1 2011/06/16 16:39:14 joerg Exp $ */
/* $NetBSD: strchr.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@ -29,7 +29,7 @@
*/
#include <machine/asm.h>
RCSID("$NetBSD: strchr.S,v 1.1 2011/06/16 16:39:14 joerg Exp $")
RCSID("$NetBSD: strchr.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
ENTRY(strchr)
popl %edx /* Return address */
@ -49,3 +49,4 @@ ENTRY(strchr)
xorl %eax, %eax
3:
ret
END(strchr)

View File

@ -1,4 +1,4 @@
/* $NetBSD: strcmp.S,v 1.1 2011/06/16 16:39:14 joerg Exp $ */
/* $NetBSD: strcmp.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@ -29,7 +29,7 @@
*/
#include <machine/asm.h>
RCSID("$NetBSD: strcmp.S,v 1.1 2011/06/16 16:39:14 joerg Exp $")
RCSID("$NetBSD: strcmp.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
ENTRY(strcmp)
pushl %esi
@ -48,3 +48,4 @@ ENTRY(strcmp)
movsbl %al, %eax
popl %esi
ret
END(strcmp)

View File

@ -1,4 +1,4 @@
/* $NetBSD: strcpy.S,v 1.1 2011/06/16 16:39:14 joerg Exp $ */
/* $NetBSD: strcpy.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@ -29,7 +29,7 @@
*/
#include <machine/asm.h>
RCSID("$NetBSD: strcpy.S,v 1.1 2011/06/16 16:39:14 joerg Exp $")
RCSID("$NetBSD: strcpy.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
ENTRY(strcpy)
pushl %esi
@ -46,3 +46,4 @@ ENTRY(strcpy)
popl %edi
popl %esi
ret
END(strcpy)

View File

@ -1,4 +1,4 @@
/* $NetBSD: strlen.S,v 1.1 2011/06/16 16:39:14 joerg Exp $ */
/* $NetBSD: strlen.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@ -29,7 +29,7 @@
*/
#include <machine/asm.h>
RCSID("$NetBSD: strlen.S,v 1.1 2011/06/16 16:39:14 joerg Exp $")
RCSID("$NetBSD: strlen.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
ENTRY(strlen)
movl 8(%esp), %ecx
xorl %eax, %eax
@ -39,3 +39,4 @@ ENTRY(strlen)
cmpb $0, 0(%ecx,%eax,1)
jnz 1b
ret
END(strlen)

View File

@ -6,7 +6,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: strcat.S,v 1.1 2005/12/20 19:28:49 christos Exp $")
RCSID("$NetBSD: strcat.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
#endif
ENTRY(strcat)
@ -125,3 +125,4 @@ ENTRY(strcat)
movl 8(%esp),%eax
popl %ebx
ret
END(strcat)

View File

@ -6,7 +6,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: strchr.S,v 1.2 2009/07/17 19:37:57 dsl Exp $")
RCSID("$NetBSD: strchr.S,v 1.3 2014/03/22 19:38:46 jakllsch Exp $")
#endif
ENTRY(strchr)
@ -99,5 +99,6 @@ ENTRY(strchr)
popl %ebx
popl %esi
ret
END(strchr)
STRONG_ALIAS(index,strchr)

View File

@ -6,7 +6,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: strcmp.S,v 1.1 2005/12/20 19:28:49 christos Exp $")
RCSID("$NetBSD: strcmp.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
#endif
ENTRY(strcmp)
@ -75,3 +75,4 @@ ENTRY(strcmp)
popl %ebx
popl %esi
ret
END(strcmp)

View File

@ -6,7 +6,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: strcpy.S,v 1.1 2005/12/20 19:28:49 christos Exp $")
RCSID("$NetBSD: strcpy.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
#endif
/*
@ -14,7 +14,7 @@
* source pointer is aligned to a word boundary, it then copies by
* words until it finds a word containing a zero byte, and finally
* copies by bytes until the end of the string is reached.
*
*
* While this may result in unaligned stores if the source and
* destination pointers are unaligned with respect to each other,
* it is still faster than either byte copies or the overhead of
@ -53,7 +53,7 @@ ENTRY(strcpy)
leal -0x01010101(%ebx),%edx
testl $0x80808080,%edx
je .Lloop
/*
* In rare cases, the above loop may exit prematurely. We must
* return to the loop if none of the bytes in the word equal 0.
@ -84,3 +84,4 @@ ENTRY(strcpy)
movl 8(%esp),%eax
popl %ebx
ret
END(strcpy)

View File

@ -6,7 +6,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: strlen.S,v 1.1 2005/12/20 19:28:49 christos Exp $")
RCSID("$NetBSD: strlen.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
#endif
ENTRY(strlen)
@ -139,3 +139,4 @@ ENTRY(strlen)
.Ldone:
subl 4(%esp),%eax
ret
END(strlen)

View File

@ -6,7 +6,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: strrchr.S,v 1.2 2009/07/17 19:37:57 dsl Exp $")
RCSID("$NetBSD: strrchr.S,v 1.3 2014/03/22 19:38:46 jakllsch Exp $")
#endif
ENTRY(strrchr)
@ -92,5 +92,6 @@ ENTRY(strrchr)
popl %edi
popl %esi
ret
END(strrchr)
STRONG_ALIAS(rindex,strrchr)