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
d6ff3c11
Commit
d6ff3c11
authored
Nov 03, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gopack: do not look for Go metadata in non-Go objects
Fixes #2333. R=r CC=golang-dev
https://golang.org/cl/5316075
parent
1738dc0e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
ar.c
src/cmd/gopack/ar.c
+12
-2
No files found.
src/cmd/gopack/ar.c
View file @
d6ff3c11
...
...
@@ -654,7 +654,7 @@ matchhdr(char *p, char **lastp)
void
scanobj
(
Biobuf
*
b
,
Arfile
*
ap
,
long
size
)
{
int
obj
;
int
obj
,
goobject
;
vlong
offset
,
offset1
;
Dir
*
d
;
static
int
lastobj
=
-
1
;
...
...
@@ -695,9 +695,19 @@ scanobj(Biobuf *b, Arfile *ap, long size)
return
;
}
goobject
=
1
;
offset1
=
Boffset
(
b
);
Bseek
(
b
,
offset
,
0
);
p
=
Brdstr
(
b
,
'\n'
,
1
);
// After the go object header comes the Go metadata,
// followed by ! on a line by itself. If this is not a Go object,
// the ! comes immediately. Catch that so we can avoid
// the call to scanpkg below, since scanpkg assumes that the
// Go metadata is present.
if
(
Bgetc
(
b
)
==
'!'
)
goobject
=
0
;
Bseek
(
b
,
offset1
,
0
);
if
(
p
==
nil
||
strncmp
(
p
,
"go object "
,
10
)
!=
0
)
{
fprint
(
2
,
"gopack: malformed object file %s
\n
"
,
file
);
...
...
@@ -734,7 +744,7 @@ scanobj(Biobuf *b, Arfile *ap, long size)
}
Bseek
(
b
,
offset
,
0
);
objtraverse
(
objsym
,
ap
);
if
(
gflag
)
{
if
(
gflag
&&
goobject
)
{
scanpkg
(
b
,
size
);
Bseek
(
b
,
offset
,
0
);
}
...
...
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