aboutsummaryrefslogtreecommitdiff
path: root/src/liblink/asm5.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/asm5.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/asm5.c')
-rw-r--r--src/liblink/asm5.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/liblink/asm5.c b/src/liblink/asm5.c
index 39aded0339..c11287c8bf 100644
--- a/src/liblink/asm5.c
+++ b/src/liblink/asm5.c
@@ -1302,7 +1302,7 @@ if(0 /*debug['G']*/) print("%ux: %s: arm %d\n", (uint32)(p->pc), p->from.sym->na
rel->siz = 4;
rel->sym = p->to.sym;
rel->add = o1 | ((v >> 2) & 0xffffff);
- rel->type = D_CALL;
+ rel->type = R_CALL;
break;
}
if(p->pcond != nil)
@@ -1372,16 +1372,16 @@ if(0 /*debug['G']*/) print("%ux: %s: arm %d\n", (uint32)(p->pc), p->from.sym->na
// to the thread-local g and m pointers.
// Emit a TLS relocation instead of a standard one.
if(rel->sym == ctxt->gmsym) {
- rel->type = D_TLS;
+ rel->type = R_TLS;
if(ctxt->flag_shared)
rel->add += ctxt->pc - p->pcrel->pc - 8 - rel->siz;
rel->xadd = rel->add;
rel->xsym = rel->sym;
} else if(ctxt->flag_shared) {
- rel->type = D_PCREL;
+ rel->type = R_PCREL;
rel->add += ctxt->pc - p->pcrel->pc - 8;
} else
- rel->type = D_ADDR;
+ rel->type = R_ADDR;
o1 = 0;
}
break;
@@ -1720,10 +1720,10 @@ if(0 /*debug['G']*/) print("%ux: %s: arm %d\n", (uint32)(p->pc), p->from.sym->na
rel->add = p->pcond->pc;
}
if(o->flag & LPCREL) {
- rel->type = D_PCREL;
+ rel->type = R_PCREL;
rel->add += ctxt->pc - p->pcrel->pc - 16 + rel->siz;
} else
- rel->type = D_ADDR;
+ rel->type = R_ADDR;
o1 = 0;
}
break;