git: 9front

Download patch

ref: b590739e2e8c7130b860fda87514053cef571cb5
parent: 63f19dda156762881efe77448fc89f619f204d03
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Jul 7 02:26:56 EDT 2015

5e: make sure stack base is aligned to avoid unaligned memory trap on arm

--- a/sys/src/cmd/5e/proc.c
+++ b/sys/src/cmd/5e/proc.c
@@ -220,7 +220,7 @@
 	text = newseg(fp.txtaddr - fp.hdrsz, fp.txtsz + fp.hdrsz, SEGTEXT);
 	data = newseg(fp.dataddr, fp.datsz, SEGDATA);
 	bss = newseg(fp.dataddr + fp.datsz, fp.bsssz, SEGBSS);
-	newseg(mach->utop - STACKSIZE, STACKSIZE, SEGSTACK);
+	newseg((mach->utop & ~7) - STACKSIZE, STACKSIZE, SEGSTACK);
 	seek(fd, fp.txtoff - fp.hdrsz, 0);
 	if(readn(fd, text->data, fp.txtsz + fp.hdrsz) < fp.txtsz + fp.hdrsz)
 		sysfatal("%r");
--