This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

inlining between sections


Folks, we have an instance here in the 2.6 kernel where gcc-3.4 is inlining
init/main.c:rest_init() inside its caller, init/main.c:start_kernel(). 
This causes the kernel to crash, because start_kernel() lives in a text
section which gets unloaded later in the boot.

I'd suggest that this is a gcc bug:

static void rest_init(void)
{
	...
}

 __attribute__((regparm(0))) void
	__attribute__ ((__section__ (".init.text")))
		start_kernel(void)
{
	...
	rest_init();
}

start_kernel() and rest_init() have been placed into different text sections,
so it is wrong to inline one inside the other.

mnm:/usr/src/25> /usr/local/gcc-cvs/bin/gcc --version
gcc (GCC) 3.5.0 20040124 (experimental)

/usr/local/gcc-cvs/bin/gcc -Wp,-MD,init/.main.s.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -msoft-float -mpreferred-stack-boundary=2 -march=i486 -mregparm=3 -Iinclude/asm-i386/mach-default -gdwarf-2 -O2 -g -funit-at-a-time -Wdeclaration-after-statement    -DKBUILD_BASENAME=main -DKBUILD_MODNAME=main -S -o init/main.s init/main.c

mnm:/usr/src/25> grep rest_init init/main.s
        .string "rest_init"
mnm:/usr/src/25> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]