Re: Questions on __initdata

From: PaweÅ Sikora
Date: Tue Dec 06 2005 - 08:31:39 EST


Dnia poniedziaÅek, 5 grudnia 2005 21:37, Ralf Baechle napisaÅ:

> blurb.c: At top level:
> blurb.c:3: error: somevariable causes a section type conflict

This was a gcc bug. The current gcc mainline works fine.

--
to_be || !to_be == 1, to_be | ~to_be == -1
.file "id.c"
.section .initdata,"aw",@progbits
.align 4
.type somevariable.0, @object
.size somevariable.0, 4
somevariable.0:
.zero 4
.section .inittext,"ax",@progbits
.p2align 4,,15
.globl somefunc
.type somefunc, @function
somefunc:
movl somevariable.0, %edx
addl %edx, %eax
movl %eax, somevariable.0
ret
.size somefunc, .-somefunc
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.3.6 (PLD Linux)"
.file "id.c"
.section .inittext,"ax",@progbits
.p2align 4,,15
.globl somefunc
.type somefunc, @function
somefunc:
addl somevariable.1299, %eax
movl %eax, somevariable.1299
ret
.size somefunc, .-somefunc
.section .initdata,"aw",@progbits
.align 4
.type somevariable.1299, @object
.size somevariable.1299, 4
somevariable.1299:
.zero 4
.ident "GCC: (GNU) 4.2.0 20051201 (experimental)"
.section .note.GNU-stack,"",@progbits
int __attribute__((section(".inittext"))) somefunc(int x)
{
static int __attribute__((section(".initdata"))) somevariable;
somevariable += x;
return somevariable;
}