1
0
mirror of https://github.com/golang/go synced 2024-11-19 07:04:43 -07:00

[dev.cc] cmd/asm: fix dev.cc 386 build: implement CALL *x(SB)

Also clean up the branch code a bit

TBR=rsc

Change-Id: I209dea750db3a6769e7ccd79bb65c4d809aba152
Reviewed-on: https://go-review.googlesource.com/4530
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Rob Pike 2015-02-10 20:22:41 -08:00
parent 7c604b0b7d
commit e90a91eac4

View File

@ -309,16 +309,11 @@ func (p *Parser) asmJump(op int, a []obj.Addr) {
prog.To = *target
case target.Type == obj.TYPE_MEM && (target.Name == obj.NAME_EXTERN || target.Name == obj.NAME_STATIC):
// JMP main·morestack(SB)
isStatic := 0
if target.Name == obj.NAME_STATIC {
isStatic = 1
}
prog.To = obj.Addr{
Type: obj.TYPE_BRANCH,
Sym: obj.Linklookup(p.linkCtxt, target.Sym.Name, isStatic),
Index: 0,
Offset: target.Offset,
}
prog.To = *target
case target.Type == obj.TYPE_INDIR && (target.Name == obj.NAME_EXTERN || target.Name == obj.NAME_STATIC):
// JMP *main·morestack(SB)
prog.To = *target
prog.To.Type = obj.TYPE_INDIR
case target.Type == obj.TYPE_MEM && target.Reg == 0 && target.Offset == 0:
// JMP exit
targetProg := p.labels[target.Sym.Name]