Subject: Re: structure alignment on arm in NetBSD? (resend without html)
To: None <tech-toolchain@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-toolchain
Date: 10/15/2007 18:11:09
In article <792C02B9D46F2F43B67C296F6D4ABEAE04C1A42E@EXCHANGE.danger.com>,
Martin Fouts <mfouts@danger.com> wrote:
>Deep in the heart of gcc sources,
>In src/gnu/dist/gcc4/gcc/config/arm/netbsd-elf.h I found the comment
>
>/* VERY BIG NOTE: Change of structure alignment for NetBSD/arm.
> There are consequences you should be aware of...
>
> Normally GCC/arm uses a structure alignment of 32 for compatibility
> with armcc. This means that structures are padded to a word
> boundary. However this causes problems with bugged NetBSD kernel
> code (possibly userland code as well - I have not checked every
> binary). The nature of this bugged code is to rely on sizeof()
> returning the correct size of various structures rounded to the
> nearest byte (SCSI and ether code are two examples, the vm system
> is another). This code breaks when the structure alignment is 32
> as sizeof() will report a word=3Drounded size. By changing the
> structure alignment to 8. GCC will conform to what is expected by
> NetBSD.
>
>(rest elided...)
>
>Is this comment still accurate?
I am not sure, but the kernel structures should be fixed instead...
christos