Re: Bad code with __initfunc() and gcc-2.7.2.3

Richard Henderson (rth@cygnus.com)
Wed, 6 Jan 1999 09:10:19 -0800


On Wed, Jan 06, 1999 at 05:53:27PM +0100, Jes Sorensen wrote:
> I am seing a really strange problem with one of my drivers (the AceNIC
> Gigabit Ethernet one) when I compile it statically into the kernel using
> 2.2.0pre4 and gcc-2.7.2.3 as it comes with Red Hat 5.2. When compiled as
> a module the code seems to be fine.

The problem is detected and reported by egcs --

drivers/net/acenic.c: In function `acenic_probe':
drivers/net/acenic.c:142: acenic_probe causes a section type conflict
drivers/net/acenic.c: In function `ace_init':
drivers/net/acenic.c:403: ace_init causes a section type conflict
drivers/net/acenic.c: In function `ace_copy':
drivers/net/acenic.c:1505: ace_copy causes a section type conflict
drivers/net/acenic.c: In function `ace_load_firmware':
drivers/net/acenic.c:1559: ace_load_firmware causes a section type conflict

The bug is in acenic_firmware.h --

u32 tigonFwText[(MAX_TEXT_LEN/4) + 1] __init = {

That should be __initdata. Since it is __init, .text.init gets
marked as being a data section rather than a code section, so
alignment pads with zeros instead of nops.

r~

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/