summaryrefslogtreecommitdiff
path: root/src/cmd/8l/pass.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/8l/pass.c')
-rw-r--r--src/cmd/8l/pass.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/src/cmd/8l/pass.c b/src/cmd/8l/pass.c
index 67acfa167..294926f29 100644
--- a/src/cmd/8l/pass.c
+++ b/src/cmd/8l/pass.c
@@ -262,12 +262,13 @@ patch(void)
s = lookup("exit", 0);
vexit = s->value;
- if(HEADTYPE == 2)
+ plan9_tos = S;
+ if(HEADTYPE == Hplan9x32)
plan9_tos = lookup("_tos", 0);
for(cursym = textp; cursym != nil; cursym = cursym->next) {
for(p = cursym->text; p != P; p = p->link) {
- if(HEADTYPE == 10) { // Windows
+ if(HEADTYPE == Hwindows) {
// Convert
// op n(GS), reg
// to
@@ -288,7 +289,7 @@ patch(void)
p->from.offset = 0x2C;
}
}
- if(HEADTYPE == 7) { // Linux
+ if(HEADTYPE == Hlinux) {
// Running binaries under Xen requires using
// MOVL 0(GS), reg
// and then off(reg) instead of saying off(GS) directly
@@ -305,7 +306,7 @@ patch(void)
p->from.offset = 0;
}
}
- if(HEADTYPE == 2) { // Plan 9
+ if(HEADTYPE == Hplan9x32) {
if(p->from.type == D_INDIR+D_GS
&& p->to.type >= D_AX && p->to.type <= D_DI) {
q = appendp(p);
@@ -412,7 +413,8 @@ dostkoff(void)
symmorestack->text->from.scale |= NOSPLIT;
}
- if(HEADTYPE == 2)
+ plan9_tos = S;
+ if(HEADTYPE == Hplan9x32)
plan9_tos = lookup("_tos", 0);
for(cursym = textp; cursym != nil; cursym = cursym->next) {
@@ -430,7 +432,7 @@ dostkoff(void)
if(!(p->from.scale & NOSPLIT)) {
p = appendp(p); // load g into CX
switch(HEADTYPE) {
- case 10: // Windows
+ case Hwindows:
p->as = AMOVL;
p->from.type = D_INDIR+D_FS;
p->from.offset = 0x2c;
@@ -443,7 +445,7 @@ dostkoff(void)
p->to.type = D_CX;
break;
- case 7: // Linux
+ case Hlinux:
p->as = AMOVL;
p->from.type = D_INDIR+D_GS;
p->from.offset = 0;
@@ -456,7 +458,7 @@ dostkoff(void)
p->to.type = D_CX;
break;
- case 2: // Plan 9
+ case Hplan9x32:
p->as = AMOVL;
p->from.type = D_EXTERN;
p->from.sym = plan9_tos;
@@ -664,15 +666,3 @@ atolwhex(char *s)
n = -n;
return n;
}
-
-void
-undef(void)
-{
- int i;
- Sym *s;
-
- for(i=0; i<NHASH; i++)
- for(s = hash[i]; s != S; s = s->hash)
- if(s->type == SXREF)
- diag("%s(%d): not defined", s->name, s->version);
-}