Commit 16e05d61 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

[PATCH] remove IN_STRING_C

IN_STRING_C was an i386-specific hack by Andi Kleen to provide out-of-line
versions of some lib/string.c functions that aren't directly used on i386
(because there are inline assembly versions).

This can cause problems if gcc chooses to transparently replace a call to one
string function with a call to another string function (the example Andi gave
was a replacement of a sprintf call with a strcpy call) which generates a
function call to the replacement function.

The problems observed by Andi only occur in recent kernels without
-fno-unit-at-a-time.

With -ffreestanding it can't even cause any problems in case we'd one day drop
the -fno-unit-at-a-time since gcc mustn't assume in a freestanding environment
that all standard C library functions are available.

The effect of this patch is a small space saving in the kernel.
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2bec6c70
......@@ -25,7 +25,6 @@
/* AK: in fact I bet it would be better to move this stuff all out of line.
*/
#if !defined(IN_STRING_C)
#define __HAVE_ARCH_STRCPY
static inline char * strcpy(char * dest,const char *src)
......@@ -180,8 +179,6 @@ __asm__ __volatile__(
return __res;
}
#endif
#define __HAVE_ARCH_STRLEN
static inline size_t strlen(const char * s)
{
......
......@@ -19,8 +19,6 @@
* - Kissed strtok() goodbye
*/
#define IN_STRING_C 1
#include <linux/types.h>
#include <linux/string.h>
#include <linux/ctype.h>
......
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