1
0
mirror of https://github.com/golang/go synced 2024-11-25 01:57:56 -07:00

5a, 5c, 5g, 5l: fix build for Linux/ARM.

ARM doesn't have the concept of scale, so I renamed the field
Addr.scale to Addr.flag to better reflect its true meaning.

R=rsc
CC=golang-dev
https://golang.org/cl/5687044
This commit is contained in:
Shenghou Ma 2012-02-19 18:11:16 -05:00 committed by Russ Cox
parent 72f5a91aa3
commit 463009ff06
9 changed files with 17 additions and 8 deletions

View File

@ -491,6 +491,7 @@ zaddr(Gen *a, int s)
Bputc(&obuf, a->type);
Bputc(&obuf, a->reg);
Bputc(&obuf, 0); // flag
Bputc(&obuf, s);
Bputc(&obuf, a->name);
switch(a->type) {

View File

@ -564,9 +564,10 @@ zaddr(char *bp, Adr *a, int s)
bp[0] = a->type;
bp[1] = a->reg;
bp[2] = s;
bp[3] = a->name;
bp += 4;
bp[2] = 0; // flag
bp[3] = s;
bp[4] = a->name;
bp += 5;
switch(a->type) {
default:
diag(Z, "unknown type %d in zaddr", a->type);

View File

@ -27,6 +27,7 @@ struct Addr
uchar reg;
char pun;
uchar etype;
char flag;
};
#define A ((Addr*)0)

View File

@ -93,6 +93,7 @@ zaddr(Biobuf *b, Addr *a, int s)
default:
Bputc(b, a->type);
Bputc(b, a->reg);
Bputc(b, a->flag);
Bputc(b, s);
Bputc(b, a->name);
}

View File

@ -254,9 +254,9 @@ ggloblnod(Node *nam, int32 width)
p->to.type = D_CONST;
p->to.offset = width;
if(nam->readonly)
p->from.scale = RODATA;
p->from.flag = RODATA;
if(nam->type != T && !haspointers(nam->type))
p->from.scale |= NOPTR;
p->from.flag |= NOPTR;
}
void
@ -273,6 +273,7 @@ ggloblsym(Sym *s, int32 width, int dupok)
p->to.offset = width;
if(dupok)
p->reg = DUPOK;
p->from.flag |= RODATA;
}
int

View File

@ -74,6 +74,7 @@ enum {
ElfStrRelPlt,
ElfStrPlt,
ElfStrNoteNetbsdIdent,
ElfStrNoPtrData,
NElfStr
};
@ -164,6 +165,7 @@ doelf(void)
elfstr[ElfStrEmpty] = addstring(shstrtab, "");
elfstr[ElfStrText] = addstring(shstrtab, ".text");
elfstr[ElfStrNoPtrData] = addstring(shstrtab, ".noptrdata");
elfstr[ElfStrData] = addstring(shstrtab, ".data");
elfstr[ElfStrBss] = addstring(shstrtab, ".bss");
if(HEADTYPE == Hnetbsd)

View File

@ -76,6 +76,7 @@ struct Adr
uchar index; // not used on arm, required by ld/go.c
char reg;
char name;
char flag;
int32 offset2; // argsize
char class;
Sym* gotype;

View File

@ -301,6 +301,7 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
a->type = Bgetc(f);
a->reg = Bgetc(f);
a->flag = Bgetc(f);
c = Bgetc(f);
if(c < 0 || c > NSYM){
print("sym out of range: %d\n", c);
@ -549,9 +550,9 @@ loop:
s->size = p->to.offset;
if(p->reg & DUPOK)
s->dupok = 1;
if(p->from.scale & RODATA)
if(p->from.flag & RODATA)
s->type = SRODATA;
else if(p->from.scale & NOPTR)
else if(p->from.flag & NOPTR)
s->type = SNOPTRDATA;
break;

View File

@ -112,7 +112,7 @@ addr(Biobuf *bp)
long off;
a.type = Bgetc(bp); /* a.type */
skip(bp,1); /* reg */
skip(bp,2); /* reg, flag */
a.sym = Bgetc(bp); /* sym index */
a.name = Bgetc(bp); /* sym type */
switch(a.type){