[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B703B@saturn3.aculab.com>
Date: Thu, 11 Oct 2012 11:16:16 +0100
From: "David Laight" <David.Laight@...LAB.COM>
To: Måns Rullgård <mans@...sr.com>
Cc: "Jon Masters" <jonathan@...masters.org>,
<linux-arm-kernel@...ts.infradead.org>, <netdev@...r.kernel.org>
Subject: RE: alignment faults in 3.6
> > It might be enough to use __attribute__((aligned(2))) on some structure
> > members (actually does 'ldm' need 8 byte alignment?? - in which case
> > aligned(4) is enough).
>
> The aligned attribute can only increase alignment.
Not true.
If you have:
struct foo {
short a;
int b __attribute__((aligned(2)));
short c;
};
You'll find sizeof (struct foo) is 8, and that, on arm/sparc etc,
gcc will generate 2 16bit accesses (and shifts) for foo.b;
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists