aboutsummaryrefslogtreecommitdiff
path: root/src/liblink/asm6.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-04-14 15:54:20 -0400
committerRuss Cox <rsc@golang.org>2014-04-14 15:54:20 -0400
commit8d39e55c6516be5ee3267b8ce101b324a4f09986 (patch)
treeacc342d354cf6456d4cf9b60afea3fc0a0547979 /src/liblink/asm6.c
parentb53bb2cae512ce4abbc1587a903171a9da6201cf (diff)
downloadgo-8d39e55c6516be5ee3267b8ce101b324a4f09986.tar.xz
liblink: remove arch-specific constants from file format
The relocation and automatic variable types were using arch-specific numbers. Introduce portable enumerations instead. To the best of my knowledge, these are the only arch-specific bits left in the new object file format. Remove now, before Go 1.3, because file formats are forever. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/87670044
Diffstat (limited to 'src/liblink/asm6.c')
-rw-r--r--src/liblink/asm6.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/liblink/asm6.c b/src/liblink/asm6.c
index 07ca35edae..213b1b55d7 100644
--- a/src/liblink/asm6.c
+++ b/src/liblink/asm6.c
@@ -2272,12 +2272,12 @@ vaddr(Link *ctxt, Addr *a, Reloc *r)
if(ctxt->flag_shared || ctxt->headtype == Hnacl) {
if(s->type == STLSBSS) {
r->xadd = r->add - r->siz;
- r->type = D_TLS;
+ r->type = R_TLS;
r->xsym = s;
} else
- r->type = D_PCREL;
+ r->type = R_PCREL;
} else
- r->type = D_ADDR;
+ r->type = R_ADDR;
}
return v;
}
@@ -3024,7 +3024,7 @@ found:
r->off = p->pc + ctxt->andptr - ctxt->and;
r->sym = p->to.sym;
r->add = p->to.offset;
- r->type = D_PCREL;
+ r->type = R_PCREL;
r->siz = 4;
put4(ctxt, 0);
break;
@@ -3042,7 +3042,7 @@ found:
r = addrel(ctxt->cursym);
r->off = p->pc + ctxt->andptr - ctxt->and;
r->sym = p->to.sym;
- r->type = D_PCREL;
+ r->type = R_PCREL;
r->siz = 4;
put4(ctxt, 0);
break;
@@ -3461,7 +3461,7 @@ asmins(Link *ctxt, Prog *p)
break;
if(ctxt->rexflag)
r->off++;
- if(r->type == D_PCREL)
+ if(r->type == R_PCREL)
r->add -= p->pc + n - (r->off + r->siz);
}