|
Message-ID: <20161218002912.GH1555@brightrain.aerifal.cx> Date: Sat, 17 Dec 2016 19:29:12 -0500 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: cortex-m support? On Thu, Dec 15, 2016 at 12:34:00PM -0600, Rob Landley wrote: > On 12/08/2016 03:11 PM, Rich Felker wrote: > > On Tue, Dec 06, 2016 at 11:52:29PM -0600, Rob Landley wrote: > >> Index: src/setjmp/arm/setjmp.S > >> =================================================================== > >> --- src/setjmp/arm/setjmp.S (revision 0) > >> +++ src/setjmp/arm/setjmp.S (revision 4920) > >> @@ -0,0 +1,45 @@ > >> +.global __setjmp > >> +.global _setjmp > >> +.global setjmp > >> +.type __setjmp,%function > >> +.type _setjmp,%function > >> +.type setjmp,%function > >> +__setjmp: > >> +_setjmp: > >> +setjmp: > >> + mov ip,r0 > >> +#if defined(__thumb__) > >> + stmia ip!,{v1,v2,v3,v4,v5,v6,sl,fp,lr} > >> + str sp, [ip], #4 > >> +#else > >> + stmia ip!,{v1,v2,v3,v4,v5,v6,sl,fp,sp,lr} > >> +#endif > > > > My leaning is to just always use the version that works on thumb, > > Presumaby there's a longjmp.S bit too because: > > ldmia ip!, {v1,v2,v3,v4,v5,v6,sl,fp,sp,lr} > > Make sure you're aware of erratum 752419: > > https://sourceware.org/ml/binutils/2011-05/msg00087.html Thanks. I wasn't aware of this. But my proposed version of the patch is already immune; it doesn't use ldr to sp, but instead ldm to a temp register followed by mov to sp. I grepped for ldr to sp and did not find any instances that are incrementing forms. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.