From: Andi Kleen This patch adds the `noinline' function attribute. It can beused to explicitly tell the compiler to not inline functions. We need this due to what is, IMO, a bug present in gcc-3.4 and current gcc-3.5 CVS: the compiler is inlining init/main.c:rest_init() inside init/main.c:start_kernel(), despite the fact that thay are declared to be placed in different text sections. --- arch/i386/mm/init.c | 0 include/linux/compiler-gcc3.h | 4 ++++ include/linux/compiler.h | 4 ++++ 3 files changed, 8 insertions(+) diff -puN arch/i386/mm/init.c~add-noinline-attribute arch/i386/mm/init.c diff -puN include/linux/compiler-gcc3.h~add-noinline-attribute include/linux/compiler-gcc3.h --- 25/include/linux/compiler-gcc3.h~add-noinline-attribute 2004-02-11 01:48:46.000000000 -0800 +++ 25-akpm/include/linux/compiler-gcc3.h 2004-02-11 01:48:46.000000000 -0800 @@ -21,3 +21,7 @@ #define __attribute_pure__ __attribute__((pure)) #define __attribute_const__ __attribute__((__const__)) + +#if __GNUC_MINOR__ >= 1 +#define noinline __attribute__((noinline)) +#endif diff -puN include/linux/compiler.h~add-noinline-attribute include/linux/compiler.h --- 25/include/linux/compiler.h~add-noinline-attribute 2004-02-11 01:48:46.000000000 -0800 +++ 25-akpm/include/linux/compiler.h 2004-02-11 01:48:46.000000000 -0800 @@ -96,6 +96,10 @@ # define __attribute_const__ /* unimplemented */ #endif +#ifndef noinline +#define noinline +#endif + /* Optimization barrier */ #ifndef barrier # define barrier() __memory_barrier() _