summary refs log tree commit diff
path: root/arm64
diff options
context:
space:
mode:
Diffstat (limited to 'arm64')
-rw-r--r--arm64/emit.c14
-rw-r--r--arm64/isel.c4
2 files changed, 10 insertions, 8 deletions
diff --git a/arm64/emit.c b/arm64/emit.c
index 292dc79..38b7e1a 100644
--- a/arm64/emit.c
+++ b/arm64/emit.c
@@ -247,10 +247,10 @@ loadaddr(Con *c, char *rn, E *e)
 {
 	char *p, *l, *s;
 
-	switch (c->reloc) {
+	switch (c->sym.type) {
 	default:
 		die("unreachable");
-	case RelDef:
+	case SGlo:
 		if (T.apple)
 			s = "\tadrp\tR, S@pageO\n"
 			    "\tadd\tR, R, S@pageoffO\n";
@@ -258,7 +258,7 @@ loadaddr(Con *c, char *rn, E *e)
 			s = "\tadrp\tR, SO\n"
 			    "\tadd\tR, R, #:lo12:SO\n";
 		break;
-	case RelThr:
+	case SThr:
 		if (T.apple)
 			s = "\tadrp\tR, S@tlvppage\n"
 			    "\tldr\tR, [R, S@tlvppageoff]\n";
@@ -269,7 +269,7 @@ loadaddr(Con *c, char *rn, E *e)
 		break;
 	}
 
-	l = str(c->label);
+	l = str(c->sym.id);
 	p = l[0] == '"' ? "" : T.assym;
 	for (; *s; s++)
 		switch (*s) {
@@ -431,9 +431,11 @@ emitins(Ins *i, E *e)
 		if (rtype(i->arg[0]) != RCon)
 			goto Table;
 		c = &e->fn->con[i->arg[0].val];
-		if (c->type != CAddr || c->bits.i)
+		if (c->type != CAddr
+		|| c->sym.type != SGlo
+		|| c->bits.i)
 			die("invalid call argument");
-		l = str(c->label);
+		l = str(c->sym.id);
 		p = l[0] == '"' ? "" : T.assym;
 		fprintf(e->f, "\tbl\t%s%s\n", p, l);
 		break;
diff --git a/arm64/isel.c b/arm64/isel.c
index 31ef242..9b062d8 100644
--- a/arm64/isel.c
+++ b/arm64/isel.c
@@ -80,7 +80,7 @@ fixarg(Ref *pr, int k, int phi, Fn *fn)
 		c = &fn->con[r0.val];
 		if (T.apple
 		&& c->type == CAddr
-		&& c->reloc == RelThr) {
+		&& c->sym.type == SThr) {
 			r1 = newtmp("isel", Kl, fn);
 			*pr = r1;
 			if (c->bits.i) {
@@ -114,7 +114,7 @@ fixarg(Ref *pr, int k, int phi, Fn *fn)
 			c = &fn->con[fn->ncon-1];
 			sprintf(buf, "\"%sfp%d\"", T.asloc, n);
 			*c = (Con){.type = CAddr};
-			c->label = intern(buf);
+			c->sym.id = intern(buf);
 			r2 = newtmp("isel", Kl, fn);
 			emit(Oload, k, r1, r2, R);
 			emit(Ocopy, Kl, r2, CON(c-fn->con), R);