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
90da636c
Commit
90da636c
authored
Jul 19, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init filename vs pkgname
SVN=128117
parent
fb3af53f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
dcl.c
src/cmd/gc/dcl.c
+6
-4
rt0_amd64.s
src/runtime/rt0_amd64.s
+1
-1
No files found.
src/cmd/gc/dcl.c
View file @
90da636c
...
...
@@ -914,11 +914,13 @@ fninit(Node *n)
maxarg
=
0
;
stksize
=
0
;
vargen
++
;
h
=
vargen
;
snprint
(
namebuf
,
sizeof
(
namebuf
),
"init_%s_function"
,
filename
);
// this is a botch since we need a known name to
// call the top level init function out of rt0
if
(
strcmp
(
package
,
"main"
)
==
0
)
h
=
999
;
snprint
(
namebuf
,
sizeof
(
namebuf
),
"init_%.3ld_function"
,
h
);
snprint
(
namebuf
,
sizeof
(
namebuf
),
"init_function"
)
;
b
=
nod
(
ODCLFUNC
,
N
,
N
);
b
->
nname
=
newname
(
lookup
(
namebuf
));
b
->
type
=
functype
(
N
,
N
,
N
);
...
...
src/runtime/rt0_amd64.s
View file @
90da636c
...
...
@@ -33,7 +33,7 @@ TEXT _rt0_amd64(SB),7,$-8
MOVQ 24(SP), AX // copy argv
MOVQ AX, 8(SP)
CALL args(SB)
CALL main·init_
999_
function(SB) // initialization
CALL main·init_function(SB) // initialization
// create a new goroutine to start program
...
...
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