From owner-freebsd-arm@FreeBSD.ORG Thu Jul 10 16:56:04 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0973DE5F for ; Thu, 10 Jul 2014 16:56:04 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E64072E26 for ; Thu, 10 Jul 2014 16:56:03 +0000 (UTC) Received: from aurora.physics.berkeley.edu (aurora.Physics.Berkeley.EDU [128.32.117.67]) (authenticated bits=0) by d.mail.sonic.net (8.14.9/8.14.9) with ESMTP id s6AGttPV021708 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Thu, 10 Jul 2014 09:55:55 -0700 Message-ID: <53BEC59B.8080402@freebsd.org> Date: Thu, 10 Jul 2014 09:55:55 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: freebsd-arm@freebsd.org Subject: Re: [andrew@freebsd.org: svn commit: r268310 - head/libexec/rtld-elf/arm] References: <20140710095433.GV45513@funkthat.com> In-Reply-To: <20140710095433.GV45513@funkthat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;AoAFD1MI5BGhwmuUdPQXfw== M;+BsoD1MI5BGhwmuUdPQXfw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2014 16:56:04 -0000 I updated my AVILA router to HEAD over the weekend. Working beautifully. Thanks! -Nathan On 07/10/14 02:54, John-Mark Gurney wrote: > I believe that this commit makes AVILA boards stable on -HEAD now... > This includes building ports (though it takes a LONG time) and other > things... Let me know if anyone has issues, and I'll try to reproduce > and track them down.. > > This means I may finally be able to upgrade my router from 9 to HEAD > and have my guest network finally support 11n... :) > > ----- Forwarded message from Andrew Turner ----- > > From: Andrew Turner > Date: Sun, 6 Jul 2014 10:24:06 +0000 (UTC) > To: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Subject: svn commit: r268310 - head/libexec/rtld-elf/arm > > Author: andrew > Date: Sun Jul 6 10:24:06 2014 > New Revision: 268310 > URL: http://svnweb.freebsd.org/changeset/base/268310 > > Log: > Align the stack in _rtld_bind_start. Normally this is called with the > correct stack alignment, however when we have a leaf function that uses > thread local storage it calls __aeabi_read_tp to get the thread pointer. > Neither GCC or clang see this as a function call so will align the stack > to a 4-byte boundary. This may be a problem as _rtld_bind expects to be > on an 8-byte boundary. > > The solution is to store a copy of the stack pointer and force the > alignment before calling _rtld_bind. > > This fixes a problem with armeb where applications would crash in odd ways. > It should also remove the need for a local patch to clang to force the > stack alignment to an 8-byte boundary, even for leaf functions. Further > testing will be needed before reverting this local change to clang as we > may rely on it in other places. > > Reviewed by: jmg@ > > Modified: > head/libexec/rtld-elf/arm/rtld_start.S > > Modified: head/libexec/rtld-elf/arm/rtld_start.S > ============================================================================== > --- head/libexec/rtld-elf/arm/rtld_start.S Sun Jul 6 07:34:18 2014 (r268309) > +++ head/libexec/rtld-elf/arm/rtld_start.S Sun Jul 6 10:24:06 2014 (r268310) > @@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$"); > * lr = &GOT[2] > */ > _rtld_bind_start: > - stmdb sp!,{r0-r4,sl,fp} > + stmdb sp!,{r0-r5,sl,fp} > > sub r1, ip, lr /* r1 = 4 * (n + 1) */ > sub r1, r1, #4 /* r1 = 4 * n */ > @@ -86,11 +86,14 @@ _rtld_bind_start: > ldr r0, [lr, #-4] /* get obj ptr from GOT[1] */ > mov r4, ip /* save GOT location */ > > + mov r5, sp /* Save the stack pointer */ > + bic sp, sp, #7 /* Align the stack pointer */ > bl _rtld_bind /* Call the binder */ > + mov sp, r5 /* Restore the old stack pointer */ > > str r0, [r4] /* save address in GOT */ > mov ip, r0 /* save new address */ > > - ldmia sp!,{r0-r4,sl,fp,lr} /* restore the stack */ > + ldmia sp!,{r0-r5,sl,fp,lr} /* restore the stack */ > mov pc, ip /* jump to the new address */ > > > ----- End forwarded message ----- >