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

Jes Sorensen (Jes.Sorensen@cern.ch)
06 Jan 1999 18:15:40 +0100


>>>>> "Richard" == Richard Henderson <rth@cygnus.com> writes:

Richard> 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.

Richard> The problem is detected and reported by egcs --

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

I actually tried compiling it with egcs but didn't really understand
the error message.

Richard> The bug is in acenic_firmware.h --

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

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

Thanks a lot, I would never have figured this one out myself.

Jes

-
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/