From owner-freebsd-arm@FreeBSD.ORG Fri Jan 18 19:15:53 2008 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23C9716A41A for ; Fri, 18 Jan 2008 19:15:53 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (casselton.net [63.165.140.2]) by mx1.freebsd.org (Postfix) with ESMTP id A581F13C457 for ; Fri, 18 Jan 2008 19:15:52 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (localhost [127.0.0.1]) by casselton.net (8.13.8/8.13.8) with ESMTP id m0IJFn2P057698; Fri, 18 Jan 2008 13:15:49 -0600 (CST) (envelope-from tinguely@casselton.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=casselton.net; s=ccnMail; t=1200683749; bh=u51KTxJ3g7brQhF4oD9DBT1mMO6FesqN/A6n4aM A3PA=; h=Date:From:Message-Id:To:Subject:Cc:In-Reply-To; b=HWWonEv6 gqfkg6EQ+0Xyp/pfsNd1icKGtgg0Qdw3f6twZjiQr4/Pb9hwxNBSqILfBS1FYUYKYUy hWnvBuD1Rxl139ohheFpmUQPjuJplw/2cTxRpP0zDM5TT/nuPh3nvAGfB88uP9WI5sZ kyFdp/+2X03Qv7lBbN6hl9DbXeoUQ= Received: (from tinguely@localhost) by casselton.net (8.13.8/8.13.8/Submit) id m0IJFndO057697; Fri, 18 Jan 2008 13:15:49 -0600 (CST) (envelope-from tinguely) Date: Fri, 18 Jan 2008 13:15:49 -0600 (CST) From: Mark Tinguely Message-Id: <200801181915.m0IJFndO057697@casselton.net> To: imp@bsdimp.com, jhay@meraka.org.za In-Reply-To: <20080118185634.GA28843@zibbi.meraka.csir.co.za> Cc: freebsd-arm@freebsd.org, des@freebsd.org Subject: Re: sshd broken on arm? X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2008 19:15:53 -0000 > Hmmm Just to make sure that I'm on the right page. On FreeBSD ARM one > is not supposed to be able to access unaligned memory? Ie. an int that > does not start on an address that is a multiple of 4. Some ARM implementation can be programmed to do unaligned accesses, but yes, halfword, word and long word accesses must be properly aligned. > In a C function if you have something like "char tmp[4]", can you assume > that the compiler will align it on a 4 byte boundary or can it do it on > a byte boundary? No it will not automatically be align correctly to be used as a integer. > If one cannot access unaligned ints and char arrays are not int aligned, > then we were just lucky that the code worked at some stage. The items above this array were probably a multiple of 4 bytes and something has changed in a structure to make this no longer true. You can find the offending structure and pad it to make it a multiple of 4 bytes, or cheat and declare a integer before the char array. --Mark Tinguely