Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
047e698c
Commit
047e698c
authored
Apr 20, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ld: remove MachoLoad limit
Fixes #1571. R=ken2 CC=golang-dev
https://golang.org/cl/4443052
parent
e1ee3b5d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
macho.c
src/cmd/ld/macho.c
+13
-6
No files found.
src/cmd/ld/macho.c
View file @
047e698c
...
...
@@ -12,10 +12,10 @@
static
int
macho64
;
static
MachoHdr
hdr
;
static
MachoLoad
load
[
16
]
;
static
MachoLoad
*
load
;
static
MachoSeg
seg
[
16
];
static
MachoDebug
xdebug
[
16
];
static
int
nload
,
nseg
,
ndebug
,
nsect
;
static
int
nload
,
mload
,
nseg
,
ndebug
,
nsect
;
void
machoinit
(
void
)
...
...
@@ -43,11 +43,18 @@ newMachoLoad(uint32 type, uint32 ndata)
{
MachoLoad
*
l
;
if
(
nload
>=
nelem
(
load
))
{
diag
(
"too many loads"
);
errorexit
();
if
(
nload
>=
mload
)
{
if
(
mload
==
0
)
mload
=
1
;
else
mload
*=
2
;
load
=
realloc
(
load
,
mload
*
sizeof
load
[
0
]);
if
(
load
==
nil
)
{
diag
(
"out of memory"
);
errorexit
();
}
}
if
(
macho64
&&
(
ndata
&
1
))
ndata
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment