Skip to content

Commit

Permalink
liblink: always use ZR instead of $0 for constants
Browse files Browse the repository at this point in the history
Fixes golang#14

Change-Id: I3737ba4e11b34e7275c840bfe9f8996a5acac88f
  • Loading branch information
4ad committed Dec 16, 2014
1 parent c229d85 commit b653a23
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/liblink/asm7.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,10 @@ span7(Link *ctxt, LSym *cursym)
if(p->as == ADWORD && ((c & 7)) != 0)
c += 4;
p->pc = c;
if (p->from.type == D_CONST && p->from.offset == 0)
p->from.reg = REGZERO;
if (p->to.type == D_CONST && p->to.offset == 0)
p->to.reg = REGZERO;
o = oplook(ctxt, p);
m = o->size;
if(m == 0) {
Expand Down

0 comments on commit b653a23

Please sign in to comment.