shithub: riscv

Download patch

ref: f109558b0c9281a22159458f1a9986ae7932ed64
parent: eaffaab79030463fff1587ea595ea104204737ed
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Jun 19 16:56:47 EDT 2017

8l, 6l: get .frame offset right undoing $-4 hack

--- a/sys/src/cmd/6l/pass.c
+++ b/sys/src/cmd/6l/pass.c
@@ -507,8 +507,10 @@
 		if(p->as == ATEXT) {
 			curtext = p;
 			autoffset = p->to.offset;
-			if(autoffset < 0)
+			if(autoffset < 0) {
 				autoffset = 0;
+				p->to.offset = 0;
+			}
 			if(autoffset) {
 				p = appendp(p);
 				p->as = AADJSP;
--- a/sys/src/cmd/8l/pass.c
+++ b/sys/src/cmd/8l/pass.c
@@ -492,8 +492,10 @@
 		if(p->as == ATEXT) {
 			curtext = p;
 			autoffset = p->to.offset;
-			if(autoffset < 0)
+			if(autoffset < 0) {
 				autoffset = 0;
+				p->to.offset = 0;
+			}
 			if(autoffset) {
 				p = appendp(p);
 				p->as = AADJSP;