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

5l, 6l, 8l: correct ELFRESERVE diagnostic

If the length of the interpreter string
pushes us over the ELFRESERVE limit, the
resulting error message will be comical.

I was doing some ELF tinkering with a
modified version of 8l when I hit this.

To be clear, the stock linkers wouldn't
hit this without adding about forty more
section headers.  We're safe for now. ;)

Also, remove a redundant call to cflush.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5268044
This commit is contained in:
Anthony Martin 2011-10-18 16:05:38 -04:00 committed by Russ Cox
parent 4566868b41
commit 033585d675
3 changed files with 6 additions and 6 deletions

View File

@ -632,8 +632,8 @@ asmb(void)
a += elfwritehdr();
a += elfwritephdrs();
a += elfwriteshdrs();
cflush();
if(a+elfwriteinterp() > ELFRESERVE)
a += elfwriteinterp();
if(a > ELFRESERVE)
diag("ELFRESERVE too small: %d > %d", a, ELFRESERVE);
break;
}

View File

@ -1095,8 +1095,8 @@ asmb(void)
a += elfwritehdr();
a += elfwritephdrs();
a += elfwriteshdrs();
cflush();
if(a+elfwriteinterp() > ELFRESERVE)
a += elfwriteinterp();
if(a > ELFRESERVE)
diag("ELFRESERVE too small: %d > %d", a, ELFRESERVE);
break;
case Hwindows:

View File

@ -1160,8 +1160,8 @@ asmb(void)
a += elfwritehdr();
a += elfwritephdrs();
a += elfwriteshdrs();
cflush();
if(a+elfwriteinterp() > ELFRESERVE)
a += elfwriteinterp();
if(a > ELFRESERVE)
diag("ELFRESERVE too small: %d > %d", a, ELFRESERVE);
break;