mirror of
https://github.com/golang/go
synced 2024-11-12 07:50:23 -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:
parent
72f5a91aa3
commit
463009ff06
@ -491,6 +491,7 @@ zaddr(Gen *a, int s)
|
|||||||
|
|
||||||
Bputc(&obuf, a->type);
|
Bputc(&obuf, a->type);
|
||||||
Bputc(&obuf, a->reg);
|
Bputc(&obuf, a->reg);
|
||||||
|
Bputc(&obuf, 0); // flag
|
||||||
Bputc(&obuf, s);
|
Bputc(&obuf, s);
|
||||||
Bputc(&obuf, a->name);
|
Bputc(&obuf, a->name);
|
||||||
switch(a->type) {
|
switch(a->type) {
|
||||||
|
@ -564,9 +564,10 @@ zaddr(char *bp, Adr *a, int s)
|
|||||||
|
|
||||||
bp[0] = a->type;
|
bp[0] = a->type;
|
||||||
bp[1] = a->reg;
|
bp[1] = a->reg;
|
||||||
bp[2] = s;
|
bp[2] = 0; // flag
|
||||||
bp[3] = a->name;
|
bp[3] = s;
|
||||||
bp += 4;
|
bp[4] = a->name;
|
||||||
|
bp += 5;
|
||||||
switch(a->type) {
|
switch(a->type) {
|
||||||
default:
|
default:
|
||||||
diag(Z, "unknown type %d in zaddr", a->type);
|
diag(Z, "unknown type %d in zaddr", a->type);
|
||||||
|
@ -27,6 +27,7 @@ struct Addr
|
|||||||
uchar reg;
|
uchar reg;
|
||||||
char pun;
|
char pun;
|
||||||
uchar etype;
|
uchar etype;
|
||||||
|
char flag;
|
||||||
};
|
};
|
||||||
#define A ((Addr*)0)
|
#define A ((Addr*)0)
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ zaddr(Biobuf *b, Addr *a, int s)
|
|||||||
default:
|
default:
|
||||||
Bputc(b, a->type);
|
Bputc(b, a->type);
|
||||||
Bputc(b, a->reg);
|
Bputc(b, a->reg);
|
||||||
|
Bputc(b, a->flag);
|
||||||
Bputc(b, s);
|
Bputc(b, s);
|
||||||
Bputc(b, a->name);
|
Bputc(b, a->name);
|
||||||
}
|
}
|
||||||
|
@ -254,9 +254,9 @@ ggloblnod(Node *nam, int32 width)
|
|||||||
p->to.type = D_CONST;
|
p->to.type = D_CONST;
|
||||||
p->to.offset = width;
|
p->to.offset = width;
|
||||||
if(nam->readonly)
|
if(nam->readonly)
|
||||||
p->from.scale = RODATA;
|
p->from.flag = RODATA;
|
||||||
if(nam->type != T && !haspointers(nam->type))
|
if(nam->type != T && !haspointers(nam->type))
|
||||||
p->from.scale |= NOPTR;
|
p->from.flag |= NOPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -273,6 +273,7 @@ ggloblsym(Sym *s, int32 width, int dupok)
|
|||||||
p->to.offset = width;
|
p->to.offset = width;
|
||||||
if(dupok)
|
if(dupok)
|
||||||
p->reg = DUPOK;
|
p->reg = DUPOK;
|
||||||
|
p->from.flag |= RODATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -74,6 +74,7 @@ enum {
|
|||||||
ElfStrRelPlt,
|
ElfStrRelPlt,
|
||||||
ElfStrPlt,
|
ElfStrPlt,
|
||||||
ElfStrNoteNetbsdIdent,
|
ElfStrNoteNetbsdIdent,
|
||||||
|
ElfStrNoPtrData,
|
||||||
NElfStr
|
NElfStr
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -164,6 +165,7 @@ doelf(void)
|
|||||||
|
|
||||||
elfstr[ElfStrEmpty] = addstring(shstrtab, "");
|
elfstr[ElfStrEmpty] = addstring(shstrtab, "");
|
||||||
elfstr[ElfStrText] = addstring(shstrtab, ".text");
|
elfstr[ElfStrText] = addstring(shstrtab, ".text");
|
||||||
|
elfstr[ElfStrNoPtrData] = addstring(shstrtab, ".noptrdata");
|
||||||
elfstr[ElfStrData] = addstring(shstrtab, ".data");
|
elfstr[ElfStrData] = addstring(shstrtab, ".data");
|
||||||
elfstr[ElfStrBss] = addstring(shstrtab, ".bss");
|
elfstr[ElfStrBss] = addstring(shstrtab, ".bss");
|
||||||
if(HEADTYPE == Hnetbsd)
|
if(HEADTYPE == Hnetbsd)
|
||||||
|
@ -76,6 +76,7 @@ struct Adr
|
|||||||
uchar index; // not used on arm, required by ld/go.c
|
uchar index; // not used on arm, required by ld/go.c
|
||||||
char reg;
|
char reg;
|
||||||
char name;
|
char name;
|
||||||
|
char flag;
|
||||||
int32 offset2; // argsize
|
int32 offset2; // argsize
|
||||||
char class;
|
char class;
|
||||||
Sym* gotype;
|
Sym* gotype;
|
||||||
|
@ -301,6 +301,7 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
|
|||||||
|
|
||||||
a->type = Bgetc(f);
|
a->type = Bgetc(f);
|
||||||
a->reg = Bgetc(f);
|
a->reg = Bgetc(f);
|
||||||
|
a->flag = Bgetc(f);
|
||||||
c = Bgetc(f);
|
c = Bgetc(f);
|
||||||
if(c < 0 || c > NSYM){
|
if(c < 0 || c > NSYM){
|
||||||
print("sym out of range: %d\n", c);
|
print("sym out of range: %d\n", c);
|
||||||
@ -549,9 +550,9 @@ loop:
|
|||||||
s->size = p->to.offset;
|
s->size = p->to.offset;
|
||||||
if(p->reg & DUPOK)
|
if(p->reg & DUPOK)
|
||||||
s->dupok = 1;
|
s->dupok = 1;
|
||||||
if(p->from.scale & RODATA)
|
if(p->from.flag & RODATA)
|
||||||
s->type = SRODATA;
|
s->type = SRODATA;
|
||||||
else if(p->from.scale & NOPTR)
|
else if(p->from.flag & NOPTR)
|
||||||
s->type = SNOPTRDATA;
|
s->type = SNOPTRDATA;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ addr(Biobuf *bp)
|
|||||||
long off;
|
long off;
|
||||||
|
|
||||||
a.type = Bgetc(bp); /* a.type */
|
a.type = Bgetc(bp); /* a.type */
|
||||||
skip(bp,1); /* reg */
|
skip(bp,2); /* reg, flag */
|
||||||
a.sym = Bgetc(bp); /* sym index */
|
a.sym = Bgetc(bp); /* sym index */
|
||||||
a.name = Bgetc(bp); /* sym type */
|
a.name = Bgetc(bp); /* sym type */
|
||||||
switch(a.type){
|
switch(a.type){
|
||||||
|
Loading…
Reference in New Issue
Block a user