Commit 27c49d8c authored by Roland Dreier's avatar Roland Dreier Committed by Linus Torvalds

[PATCH] Export all functions in lib/string.c

Quite a few functions in lib/string.c are not exported.  I ran into this
trying to use strnchr() in a module.

This patch
 - exports every function defined in lib/string.c
 - adds some missing __HAVE_ARCH_xxx defines for i386
 - gets rid of the exports of functions from lib/string.c in arch/s390
   (BTW, why is s390 exporting things NOVERS?)
Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1831c884
...@@ -394,12 +394,3 @@ void *memset(void *s, int c, size_t n) ...@@ -394,12 +394,3 @@ void *memset(void *s, int c, size_t n)
return s; return s;
} }
EXPORT_SYMBOL_NOVERS(memset); EXPORT_SYMBOL_NOVERS(memset);
/*
* missing exports for string functions defined in lib/string.c
*/
EXPORT_SYMBOL_NOVERS(memmove);
EXPORT_SYMBOL_NOVERS(strchr);
EXPORT_SYMBOL_NOVERS(strnchr);
EXPORT_SYMBOL_NOVERS(strncmp);
EXPORT_SYMBOL_NOVERS(strpbrk);
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
*/ */
#if !defined(IN_STRING_C) #if !defined(IN_STRING_C)
#define __HAVE_ARCH_STRCPY
static inline char * strcpy(char * dest,const char *src) static inline char * strcpy(char * dest,const char *src)
{ {
int d0, d1, d2; int d0, d1, d2;
...@@ -40,6 +41,7 @@ __asm__ __volatile__( ...@@ -40,6 +41,7 @@ __asm__ __volatile__(
return dest; return dest;
} }
#define __HAVE_ARCH_STRNCPY
static inline char * strncpy(char * dest,const char *src,size_t count) static inline char * strncpy(char * dest,const char *src,size_t count)
{ {
int d0, d1, d2, d3; int d0, d1, d2, d3;
...@@ -58,6 +60,7 @@ __asm__ __volatile__( ...@@ -58,6 +60,7 @@ __asm__ __volatile__(
return dest; return dest;
} }
#define __HAVE_ARCH_STRCAT
static inline char * strcat(char * dest,const char * src) static inline char * strcat(char * dest,const char * src)
{ {
int d0, d1, d2, d3; int d0, d1, d2, d3;
...@@ -74,6 +77,7 @@ __asm__ __volatile__( ...@@ -74,6 +77,7 @@ __asm__ __volatile__(
return dest; return dest;
} }
#define __HAVE_ARCH_STRNCAT
static inline char * strncat(char * dest,const char * src,size_t count) static inline char * strncat(char * dest,const char * src,size_t count)
{ {
int d0, d1, d2, d3; int d0, d1, d2, d3;
...@@ -96,6 +100,7 @@ __asm__ __volatile__( ...@@ -96,6 +100,7 @@ __asm__ __volatile__(
return dest; return dest;
} }
#define __HAVE_ARCH_STRCMP
static inline int strcmp(const char * cs,const char * ct) static inline int strcmp(const char * cs,const char * ct)
{ {
int d0, d1; int d0, d1;
...@@ -116,6 +121,7 @@ __asm__ __volatile__( ...@@ -116,6 +121,7 @@ __asm__ __volatile__(
return __res; return __res;
} }
#define __HAVE_ARCH_STRNCMP
static inline int strncmp(const char * cs,const char * ct,size_t count) static inline int strncmp(const char * cs,const char * ct,size_t count)
{ {
register int __res; register int __res;
...@@ -138,6 +144,7 @@ __asm__ __volatile__( ...@@ -138,6 +144,7 @@ __asm__ __volatile__(
return __res; return __res;
} }
#define __HAVE_ARCH_STRCHR
static inline char * strchr(const char * s, int c) static inline char * strchr(const char * s, int c)
{ {
int d0; int d0;
...@@ -156,6 +163,7 @@ __asm__ __volatile__( ...@@ -156,6 +163,7 @@ __asm__ __volatile__(
return __res; return __res;
} }
#define __HAVE_ARCH_STRRCHR
static inline char * strrchr(const char * s, int c) static inline char * strrchr(const char * s, int c)
{ {
int d0, d1; int d0, d1;
......
...@@ -75,6 +75,7 @@ char * strcpy(char * dest,const char *src) ...@@ -75,6 +75,7 @@ char * strcpy(char * dest,const char *src)
/* nothing */; /* nothing */;
return tmp; return tmp;
} }
EXPORT_SYMBOL(strcpy);
#endif #endif
#ifndef __HAVE_ARCH_STRNCPY #ifndef __HAVE_ARCH_STRNCPY
...@@ -98,6 +99,7 @@ char * strncpy(char * dest,const char *src,size_t count) ...@@ -98,6 +99,7 @@ char * strncpy(char * dest,const char *src,size_t count)
} }
return dest; return dest;
} }
EXPORT_SYMBOL(strncpy);
#endif #endif
#ifndef __HAVE_ARCH_STRLCPY #ifndef __HAVE_ARCH_STRLCPY
...@@ -143,6 +145,7 @@ char * strcat(char * dest, const char * src) ...@@ -143,6 +145,7 @@ char * strcat(char * dest, const char * src)
return tmp; return tmp;
} }
EXPORT_SYMBOL(strcat);
#endif #endif
#ifndef __HAVE_ARCH_STRNCAT #ifndef __HAVE_ARCH_STRNCAT
...@@ -172,6 +175,7 @@ char * strncat(char *dest, const char *src, size_t count) ...@@ -172,6 +175,7 @@ char * strncat(char *dest, const char *src, size_t count)
return tmp; return tmp;
} }
EXPORT_SYMBOL(strncat);
#endif #endif
#ifndef __HAVE_ARCH_STRLCAT #ifndef __HAVE_ARCH_STRLCAT
...@@ -218,6 +222,7 @@ int strcmp(const char * cs,const char * ct) ...@@ -218,6 +222,7 @@ int strcmp(const char * cs,const char * ct)
return __res; return __res;
} }
EXPORT_SYMBOL(strcmp);
#endif #endif
#ifndef __HAVE_ARCH_STRNCMP #ifndef __HAVE_ARCH_STRNCMP
...@@ -239,6 +244,7 @@ int strncmp(const char * cs,const char * ct,size_t count) ...@@ -239,6 +244,7 @@ int strncmp(const char * cs,const char * ct,size_t count)
return __res; return __res;
} }
EXPORT_SYMBOL(strncmp);
#endif #endif
#ifndef __HAVE_ARCH_STRCHR #ifndef __HAVE_ARCH_STRCHR
...@@ -254,6 +260,7 @@ char * strchr(const char * s, int c) ...@@ -254,6 +260,7 @@ char * strchr(const char * s, int c)
return NULL; return NULL;
return (char *) s; return (char *) s;
} }
EXPORT_SYMBOL(strchr);
#endif #endif
#ifndef __HAVE_ARCH_STRRCHR #ifndef __HAVE_ARCH_STRRCHR
...@@ -271,6 +278,7 @@ char * strrchr(const char * s, int c) ...@@ -271,6 +278,7 @@ char * strrchr(const char * s, int c)
} while (--p >= s); } while (--p >= s);
return NULL; return NULL;
} }
EXPORT_SYMBOL(strrchr);
#endif #endif
#ifndef __HAVE_ARCH_STRNCHR #ifndef __HAVE_ARCH_STRNCHR
...@@ -287,6 +295,7 @@ char *strnchr(const char *s, size_t count, int c) ...@@ -287,6 +295,7 @@ char *strnchr(const char *s, size_t count, int c)
return (char *) s; return (char *) s;
return NULL; return NULL;
} }
EXPORT_SYMBOL(strnchr);
#endif #endif
#ifndef __HAVE_ARCH_STRLEN #ifndef __HAVE_ARCH_STRLEN
...@@ -302,6 +311,7 @@ size_t strlen(const char * s) ...@@ -302,6 +311,7 @@ size_t strlen(const char * s)
/* nothing */; /* nothing */;
return sc - s; return sc - s;
} }
EXPORT_SYMBOL(strlen);
#endif #endif
#ifndef __HAVE_ARCH_STRNLEN #ifndef __HAVE_ARCH_STRNLEN
...@@ -318,6 +328,7 @@ size_t strnlen(const char * s, size_t count) ...@@ -318,6 +328,7 @@ size_t strnlen(const char * s, size_t count)
/* nothing */; /* nothing */;
return sc - s; return sc - s;
} }
EXPORT_SYMBOL(strnlen);
#endif #endif
#ifndef __HAVE_ARCH_STRSPN #ifndef __HAVE_ARCH_STRSPN
...@@ -371,6 +382,7 @@ size_t strcspn(const char *s, const char *reject) ...@@ -371,6 +382,7 @@ size_t strcspn(const char *s, const char *reject)
return count; return count;
} }
EXPORT_SYMBOL(strcspn);
#ifndef __HAVE_ARCH_STRPBRK #ifndef __HAVE_ARCH_STRPBRK
/** /**
...@@ -390,6 +402,7 @@ char * strpbrk(const char * cs,const char * ct) ...@@ -390,6 +402,7 @@ char * strpbrk(const char * cs,const char * ct)
} }
return NULL; return NULL;
} }
EXPORT_SYMBOL(strpbrk);
#endif #endif
#ifndef __HAVE_ARCH_STRSEP #ifndef __HAVE_ARCH_STRSEP
...@@ -440,6 +453,7 @@ void * memset(void * s,int c,size_t count) ...@@ -440,6 +453,7 @@ void * memset(void * s,int c,size_t count)
return s; return s;
} }
EXPORT_SYMBOL(memset);
#endif #endif
#ifndef __HAVE_ARCH_BCOPY #ifndef __HAVE_ARCH_BCOPY
...@@ -463,6 +477,7 @@ void bcopy(const void * srcp, void * destp, size_t count) ...@@ -463,6 +477,7 @@ void bcopy(const void * srcp, void * destp, size_t count)
while (count--) while (count--)
*dest++ = *src++; *dest++ = *src++;
} }
EXPORT_SYMBOL(bcopy);
#endif #endif
#ifndef __HAVE_ARCH_MEMCPY #ifndef __HAVE_ARCH_MEMCPY
...@@ -484,6 +499,7 @@ void * memcpy(void * dest,const void *src,size_t count) ...@@ -484,6 +499,7 @@ void * memcpy(void * dest,const void *src,size_t count)
return dest; return dest;
} }
EXPORT_SYMBOL(memcpy);
#endif #endif
#ifndef __HAVE_ARCH_MEMMOVE #ifndef __HAVE_ARCH_MEMMOVE
...@@ -514,6 +530,7 @@ void * memmove(void * dest,const void *src,size_t count) ...@@ -514,6 +530,7 @@ void * memmove(void * dest,const void *src,size_t count)
return dest; return dest;
} }
EXPORT_SYMBOL(memmove);
#endif #endif
#ifndef __HAVE_ARCH_MEMCMP #ifndef __HAVE_ARCH_MEMCMP
...@@ -533,6 +550,7 @@ int memcmp(const void * cs,const void * ct,size_t count) ...@@ -533,6 +550,7 @@ int memcmp(const void * cs,const void * ct,size_t count)
break; break;
return res; return res;
} }
EXPORT_SYMBOL(memcmp);
#endif #endif
#ifndef __HAVE_ARCH_MEMSCAN #ifndef __HAVE_ARCH_MEMSCAN
...@@ -557,6 +575,7 @@ void * memscan(void * addr, int c, size_t size) ...@@ -557,6 +575,7 @@ void * memscan(void * addr, int c, size_t size)
} }
return (void *) p; return (void *) p;
} }
EXPORT_SYMBOL(memscan);
#endif #endif
#ifndef __HAVE_ARCH_STRSTR #ifndef __HAVE_ARCH_STRSTR
...@@ -581,6 +600,7 @@ char * strstr(const char * s1,const char * s2) ...@@ -581,6 +600,7 @@ char * strstr(const char * s1,const char * s2)
} }
return NULL; return NULL;
} }
EXPORT_SYMBOL(strstr);
#endif #endif
#ifndef __HAVE_ARCH_MEMCHR #ifndef __HAVE_ARCH_MEMCHR
...@@ -603,5 +623,5 @@ void *memchr(const void *s, int c, size_t n) ...@@ -603,5 +623,5 @@ void *memchr(const void *s, int c, size_t n)
} }
return NULL; return NULL;
} }
EXPORT_SYMBOL(memchr);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment