Subject: Re: structure alignment on arm in NetBSD? (resend without html)
To: None <>
From: Christos Zoulas <>
List: tech-toolchain
Date: 10/16/2007 17:03:37
In article <>,
Valeriy E. Ushakov <> wrote:
>On Mon, Oct 15, 2007 at 18:11:09 +0000, Christos Zoulas wrote:
>> I am not sure, but the kernel structures should be fixed instead...
>As far as I understand, if ABI enforces 32-bit alignment on structs
>there's just no chance you can express things like the following, so I
>don't see how can you "fix" kernel structures for that.
>struct foo { /* common 2-bytes header */
>	uint8_t a;
>	uint8_t b;
>struct bar { /* some 4-bytes "packet" with common header */
>	struct foo;	/* oops, has two bytes of tail padding */
>	uint8_t c;
>	uint8_t d;
>I guess that's why AAPCS reverted to naturally aligned structs.

Either by __attribute__((__packed__)) or by not using a struct.