Skip to content

Commit

Permalink
liblink: don't grow symbols in the middle of the instruction stream
Browse files Browse the repository at this point in the history
Basically revert d72d223. d72d223 was wrong. The size of a symbol is
correctly calculated before generating the machine code image. The fault
described in d72d223 was due to the problem fixed in b6e15ed.

Fixes golang#33
  • Loading branch information
4ad committed Jan 8, 2015
1 parent b6e15ed commit 4c25097
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/liblink/asm7.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,11 +702,6 @@ span7(Link *ctxt, LSym *cursym)
*(int32*)bp = 0;
bp += 4;
psz += 4;
cursym->size += 4;
if (cursym->size >= cursym->maxp) {
symgrow(ctxt, cursym, cursym->size);
bp = cursym->p;
}
}
if(o->size > 4*nelem(out))
sysfatal("out array in span7 is too small, need at least %d for %P", o->size/4, p);
Expand Down

0 comments on commit 4c25097

Please sign in to comment.