Browse Source

"rel" fields become "reloc"

Quentin Carbonneaux 3 years ago
parent
commit
4e90b4210e
9 changed files with 17 additions and 17 deletions
  1. 1 1
      alias.c
  2. 2 2
      all.h
  3. 2 2
      amd64/emit.c
  4. 1 1
      arm64/emit.c
  5. 5 5
      fold.c
  6. 1 1
      load.c
  7. 1 1
      parse.c
  8. 3 3
      rv64/emit.c
  9. 1 1
      util.c

+ 1 - 1
alias.c

@@ -19,7 +19,7 @@ getalias(Alias *a, Ref r, Fn *fn)
 		if (c->type == CAddr) {
 			a->type = ASym;
 			a->label = c->label;
-			a->rel = c->rel;
+			a->reloc = c->reloc;
 		} else
 			a->type = ACon;
 		a->offset = c->bits.i;

+ 2 - 2
all.h

@@ -282,7 +282,7 @@ struct Alias {
 	Ref base;
 	uint32_t label;
 	int64_t offset;
-	int rel;
+	int reloc;
 	Alias *slot;
 };
 
@@ -328,7 +328,7 @@ struct Con {
 	enum {
 		RelDef,
 		RelThr,
-	} rel;
+	} reloc;
 	char flt; /* 1 to print as s, 2 to print as d */
 };
 

+ 2 - 2
amd64/emit.c

@@ -167,7 +167,7 @@ emitcon(Con *con, FILE *f)
 	case CAddr:
 		l = str(con->label);
 		p = l[0] == '"' ? "" : T.assym;
-		if (con->rel == RelThr)
+		if (con->reloc == RelThr)
 			fprintf(f, "%%fs:%s%s@tpoff", p, l);
 		else
 			fprintf(f, "%s%s", p, l);
@@ -340,7 +340,7 @@ Next:
 		case RCon:
 			off = fn->con[ref.val];
 			emitcon(&off, f);
-			if (off.type == CAddr && off.rel != RelThr)
+			if (off.type == CAddr && off.reloc != RelThr)
 				fprintf(f, "(%%rip)");
 			break;
 		case RTmp:

+ 1 - 1
arm64/emit.c

@@ -263,7 +263,7 @@ loadaddr(Con *c, char *rn, E *e)
 		off[0] = 0;
 	l = str(c->label);
 	p = l[0] == '"' ? "" : T.assym;
-	if (c->rel == RelThr) {
+	if (c->reloc == RelThr) {
 		fprintf(e->f, "\tmrs\t%s, tpidr_el0\n", rn);
 		fprintf(e->f, "\tadd\t%s, %s, #:tprel_hi12:%s%s%s, lsl #12\n",
 			rn, rn, p, l, off);

+ 5 - 5
fold.c

@@ -346,12 +346,12 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr)
 			if (cr->type == CAddr)
 				return 1;
 			lab = cl->label;
-			rel = cl->rel;
+			rel = cl->reloc;
 			typ = CAddr;
 		}
 		else if (cr->type == CAddr) {
 			lab = cr->label;
-			rel = cr->rel;
+			rel = cr->reloc;
 			typ = CAddr;
 		}
 	}
@@ -359,7 +359,7 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr)
 		if (cl->type == CAddr) {
 			if (cr->type != CAddr) {
 				lab = cl->label;
-				rel = cl->rel;
+				rel = cl->reloc;
 				typ = CAddr;
 			} else if (cl->label != cr->label)
 				return 1;
@@ -408,7 +408,7 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr)
 		x = l.u;
 		if (cl->type == CAddr) {
 			lab = cl->label;
-			rel = cl->rel;
+			rel = cl->reloc;
 			typ = CAddr;
 		}
 		break;
@@ -462,7 +462,7 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr)
 		else
 			die("unreachable");
 	}
-	*res = (Con){.type=typ, .label=lab, .rel=rel, .bits={.i=x}};
+	*res = (Con){.type=typ, .label=lab, .reloc=rel, .bits={.i=x}};
 	return 0;
 }
 

+ 1 - 1
load.c

@@ -155,7 +155,7 @@ load(Slice sl, bits msk, Loc *l)
 			c.type = CAddr;
 			c.label = a->label;
 			c.bits.i = a->offset;
-			c.rel = a->rel;
+			c.reloc = a->reloc;
 			r = newcon(&c, curf);
 			break;
 		}

+ 1 - 1
parse.c

@@ -420,7 +420,7 @@ parseref()
 		c.flt = 2;
 		break;
 	case Tthread:
-		c.rel = RelThr;
+		c.reloc = RelThr;
 		expect(Tglo);
 		/* fall through */
 	case Tglo:

+ 3 - 3
rv64/emit.c

@@ -129,7 +129,7 @@ slot(int s, Fn *fn)
 static void
 emitaddr(Con *c, FILE *f)
 {
-	assert(c->rel == RelDef);
+	assert(c->reloc == RelDef);
 	fputs(str(c->label), f);
 	if (c->bits.i)
 		fprintf(f, "+%"PRIi64, c->bits.i);
@@ -229,7 +229,7 @@ loadaddr(Con *c, char *rn, FILE *f)
 {
 	char off[32];
 
-	if (c->rel == RelThr) {
+	if (c->reloc == RelThr) {
 		if (c->bits.i)
 			sprintf(off, "+%"PRIi64, c->bits.i);
 		else
@@ -279,7 +279,7 @@ fixmem(Ref *pr, Fn *fn, FILE *f)
 	r = *pr;
 	if (rtype(r) == RCon) {
 		c = &fn->con[r.val];
-		if (c->type == CAddr && c->rel == RelThr) {
+		if (c->type == CAddr && c->reloc == RelThr) {
 			loadcon(c, T6, Kl, f);
 			*pr = TMP(T6);
 		}

+ 1 - 1
util.c

@@ -360,7 +360,7 @@ newcon(Con *c0, Fn *fn)
 		if (c0->type == c1->type
 		&& c0->label == c1->label
 		&& c0->bits.i == c1->bits.i
-		&& c0->rel == c1->rel)
+		&& c0->reloc == c1->reloc)
 			return CON(i);
 	}
 	vgrow(&fn->con, ++fn->ncon);