Mailinglist Archive: opensuse-bugs (4691 mails)

< Previous Next >
[Bug 582222] kernel panic on boot with gcc-4.5-compiled kernel (Attempted to kill init!)
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Wed, 24 Feb 2010 15:23:22 +0000
  • Message-id: <20100224152322.7B75BCC7CD@xxxxxxxxxxxxxxxxxxxxxx>

--- Comment #12 from Michael Matz <matz@xxxxxxxxxx> 2010-02-24 15:23:21 UTC ---
Thanks, I can reproduce it now, it's a latent kernel problem that is now
exposed with GCC 4.5. It can be demonstrated with such testcase:

struct X {
char c[176];
#define __used __attribute__((__used__))
#define __al4 __attribute__((__aligned__(4)))
static struct X x;
static struct X __used __al4 __attribute__((section("x"))) x = { .c[0] = 1 };

Here the object 'x' will have alignment of 8 (in gcc44 or less) or 32 (since
gcc45), despite the aligned(4) attribute. This is because the first seen
declaration doesn't have such attribute. The attributes of all decls of
the same object are merged, and for alignment this means choosing the larger
one (this is correct because there might have been code emitted that only
saw the first decl relying on the larger default alignment).

You either need to remove the first decl, or annotate it with the same
attributes (at least with the aligned attribute).

This wasn't exposed with former GCCs because there the default alignment
was 8 (and as the struct size is 176, which is divisible by 8, align to 8 or 4
doesn't make a difference, but you can see the wrong .align 8 directives also
with gcc44 in the .s file). More recent GCCs align large structs to 32byte
by default.

Configure bugmail:
------- You are receiving this mail because: -------
You are on the CC list for the bug.

< Previous Next >