mirror of
https://github.com/golang/go
synced 2024-11-22 00:44:39 -07:00
ld: remove MachoLoad limit
Fixes #1571. R=ken2 CC=golang-dev https://golang.org/cl/4443052
This commit is contained in:
parent
e1ee3b5db6
commit
047e698c52
@ -12,10 +12,10 @@
|
|||||||
|
|
||||||
static int macho64;
|
static int macho64;
|
||||||
static MachoHdr hdr;
|
static MachoHdr hdr;
|
||||||
static MachoLoad load[16];
|
static MachoLoad *load;
|
||||||
static MachoSeg seg[16];
|
static MachoSeg seg[16];
|
||||||
static MachoDebug xdebug[16];
|
static MachoDebug xdebug[16];
|
||||||
static int nload, nseg, ndebug, nsect;
|
static int nload, mload, nseg, ndebug, nsect;
|
||||||
|
|
||||||
void
|
void
|
||||||
machoinit(void)
|
machoinit(void)
|
||||||
@ -43,11 +43,18 @@ newMachoLoad(uint32 type, uint32 ndata)
|
|||||||
{
|
{
|
||||||
MachoLoad *l;
|
MachoLoad *l;
|
||||||
|
|
||||||
if(nload >= nelem(load)) {
|
if(nload >= mload) {
|
||||||
diag("too many loads");
|
if(mload == 0)
|
||||||
errorexit();
|
mload = 1;
|
||||||
|
else
|
||||||
|
mload *= 2;
|
||||||
|
load = realloc(load, mload*sizeof load[0]);
|
||||||
|
if(load == nil) {
|
||||||
|
diag("out of memory");
|
||||||
|
errorexit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(macho64 && (ndata & 1))
|
if(macho64 && (ndata & 1))
|
||||||
ndata++;
|
ndata++;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user