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:
parent
4566868b41
commit
033585d675
@ -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;
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user