Date: Thu, 24 Jan 2008 17:16:58 +0100 From: Willem Jan Withagen <wjw@digiware.nl> To: "M. Warner Losh" <imp@bsdimp.com> Cc: freebsd-arm@FreeBSD.ORG, des@FreeBSD.ORG Subject: Re: sshd broken on arm? Message-ID: <4798B9FA.9070501@digiware.nl> In-Reply-To: <20080124.084828.1608359032.imp@bsdimp.com> References: <20080118.145436.-1540399028.imp@bsdimp.com> <20080124114039.GF79134@zibbi.meraka.csir.co.za> <479880A7.1030107@digiware.nl> <20080124.084828.1608359032.imp@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
M. Warner Losh wrote: > In message: <479880A7.1030107@digiware.nl> > Willem Jan Withagen <wjw@digiware.nl> writes: > : John Hay and others wrote: > : > Just adding __aligned(4) like Warner suggested also fix the problem. > : > + char tmp[CMSG_SPACE(sizeof(int))] __aligned(4); > : > So what should we do? > : > : I would say that the correct fix would be to fix the compiler. > : Going through all the code and make sure that everything is correctly > : aligned would be a humongous task.... > > Actually, the above fix *IS* the correct fix for arm given the ABI > that we're using... Well usually this is the punishment one get when jumping right in, without lurking for a longer time..... I only subscribed to this specific freebsd-arm recently, 'cause my job requires me to start doing ARM. So other than a few years of FreeBSD and my general knowledge on systems and Compilers I have not followed the discussion on the way things are coded. Given that tricks like accessing char-arrays with int pointers is a bit of a stretch, but not a very uncommon one, the following question pops in my mind: Does this then require programmers to real carefully look at what they are whiping up on code, to make shure that they don't by accident run into un-aligned access? And how about all that is already lying about?? Even still if this is mostly an embedded platform... Other than on the newer ARMs where unalinged access IS possible. Something that was not in my book, but I was told that is in the new v6 architecture. crawling back into his corner to do some more list searching. --WjW
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4798B9FA.9070501>