This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
inlining between sections
- From: Andrew Morton <akpm at osdl dot org>
- To: gcc at gcc dot gnu dot org
- Cc: Zwane Mwaikambo <zwane at holomorphy dot com>
- Date: Sun, 25 Jan 2004 22:51:35 -0800
- Subject: 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>