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
54aba2e6
Commit
54aba2e6
authored
Oct 19, 2010
by
Luuk van Dijk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[68]l: expose genasmsym.
R=rsc CC=golang-dev
https://golang.org/cl/2512042
parent
e64280ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
16 deletions
+26
-16
l.h
src/cmd/6l/l.h
+1
-0
l.h
src/cmd/8l/l.h
+1
-0
symtab.c
src/cmd/8l/symtab.c
+24
-16
No files found.
src/cmd/6l/l.h
View file @
54aba2e6
...
...
@@ -397,6 +397,7 @@ void doprof2(void);
void
dostkoff
(
void
);
vlong
entryvalue
(
void
);
void
follow
(
void
);
void
genasmsym
(
void
(
*
put
)(
char
*
,
int
,
vlong
,
vlong
,
int
,
Sym
*
));
void
gethunk
(
void
);
void
gotypestrings
(
void
);
void
listinit
(
void
);
...
...
src/cmd/8l/l.h
View file @
54aba2e6
...
...
@@ -346,6 +346,7 @@ void doprof2(void);
void
dostkoff
(
void
);
int32
entryvalue
(
void
);
void
follow
(
void
);
void
genasmsym
(
void
(
*
put
)(
char
*
,
int
,
vlong
,
vlong
,
int
,
Sym
*
));
void
instinit
(
void
);
void
listinit
(
void
);
Sym
*
lookup
(
char
*
,
int
);
...
...
src/cmd/8l/symtab.c
View file @
54aba2e6
...
...
@@ -34,7 +34,7 @@
#include "../ld/lib.h"
void
putsymb
(
char
*
s
,
int
t
,
int32
v
,
int
ver
,
Sym
*
go
)
putsymb
(
char
*
s
,
int
t
,
vlong
v
,
vlong
size
,
int
ver
,
Sym
*
go
)
{
int
i
,
f
;
vlong
gv
;
...
...
@@ -89,7 +89,7 @@ putsymb(char *s, int t, int32 v, int ver, Sym *go)
}
void
asmsym
(
void
)
genasmsym
(
void
(
*
put
)(
char
*
,
int
,
vlong
,
vlong
,
int
,
Sym
*
)
)
{
Auto
*
a
;
Sym
*
s
;
...
...
@@ -97,10 +97,10 @@ asmsym(void)
s
=
lookup
(
"etext"
,
0
);
if
(
s
->
type
==
STEXT
)
put
symb
(
s
->
name
,
'T'
,
s
->
valu
e
,
s
->
version
,
0
);
put
(
s
->
name
,
'T'
,
s
->
value
,
s
->
siz
e
,
s
->
version
,
0
);
for
(
h
=
0
;
h
<
NHASH
;
h
++
)
for
(
s
=
hash
[
h
];
s
!=
S
;
s
=
s
->
hash
)
for
(
h
=
0
;
h
<
NHASH
;
h
++
)
{
for
(
s
=
hash
[
h
];
s
!=
S
;
s
=
s
->
hash
)
{
switch
(
s
->
type
)
{
case
SCONST
:
case
SRODATA
:
...
...
@@ -108,52 +108,60 @@ asmsym(void)
case
SELFDATA
:
if
(
!
s
->
reachable
)
continue
;
put
symb
(
s
->
name
,
'D'
,
symaddr
(
s
)
,
s
->
version
,
s
->
gotype
);
put
(
s
->
name
,
'D'
,
symaddr
(
s
),
s
->
size
,
s
->
version
,
s
->
gotype
);
continue
;
case
SMACHO
:
if
(
!
s
->
reachable
)
continue
;
put
symb
(
s
->
name
,
'D'
,
s
->
value
+
INITDAT
+
segdata
.
filelen
-
dynptr
size
,
s
->
version
,
s
->
gotype
);
put
(
s
->
name
,
'D'
,
s
->
value
+
INITDAT
+
segdata
.
filelen
-
dynptrsize
,
s
->
size
,
s
->
version
,
s
->
gotype
);
continue
;
case
SBSS
:
if
(
!
s
->
reachable
)
continue
;
put
symb
(
s
->
name
,
'B'
,
s
->
value
+
INITDAT
,
s
->
version
,
s
->
gotype
);
put
(
s
->
name
,
'B'
,
s
->
value
+
INITDAT
,
s
->
size
,
s
->
version
,
s
->
gotype
);
continue
;
case
SFIXED
:
put
symb
(
s
->
name
,
'B'
,
s
->
valu
e
,
s
->
version
,
s
->
gotype
);
put
(
s
->
name
,
'B'
,
s
->
value
,
s
->
siz
e
,
s
->
version
,
s
->
gotype
);
continue
;
case
SFILE
:
put
symb
(
s
->
name
,
'f'
,
s
->
value
,
s
->
version
,
0
);
put
(
s
->
name
,
'f'
,
s
->
value
,
0
,
s
->
version
,
0
);
continue
;
}
}
}
for
(
s
=
textp
;
s
!=
nil
;
s
=
s
->
next
)
{
/* filenames first */
for
(
a
=
s
->
autom
;
a
;
a
=
a
->
link
)
if
(
a
->
type
==
D_FILE
)
put
symb
(
a
->
asym
->
name
,
'z'
,
a
->
aoffset
,
0
,
0
);
put
(
a
->
asym
->
name
,
'z'
,
a
->
aoffset
,
0
,
0
,
0
);
else
if
(
a
->
type
==
D_FILE1
)
put
symb
(
a
->
asym
->
name
,
'Z'
,
a
->
aoffset
,
0
,
0
);
put
(
a
->
asym
->
name
,
'Z'
,
a
->
aoffset
,
0
,
0
,
0
);
put
symb
(
s
->
name
,
'T'
,
s
->
valu
e
,
s
->
version
,
s
->
gotype
);
put
(
s
->
name
,
'T'
,
s
->
value
,
s
->
siz
e
,
s
->
version
,
s
->
gotype
);
/* frame, auto and param after */
put
symb
(
".frame"
,
'm'
,
s
->
text
->
to
.
offset
+
4
,
0
,
0
);
put
(
".frame"
,
'm'
,
s
->
text
->
to
.
offset
+
4
,
0
,
0
,
0
);
for
(
a
=
s
->
autom
;
a
;
a
=
a
->
link
)
if
(
a
->
type
==
D_AUTO
)
put
symb
(
a
->
asym
->
name
,
'a'
,
-
a
->
aoffset
,
0
,
a
->
gotype
);
put
(
a
->
asym
->
name
,
'a'
,
-
a
->
aoffset
,
0
,
0
,
a
->
gotype
);
else
if
(
a
->
type
==
D_PARAM
)
put
symb
(
a
->
asym
->
name
,
'p'
,
a
->
aoffset
,
0
,
a
->
gotype
);
put
(
a
->
asym
->
name
,
'p'
,
a
->
aoffset
,
0
,
0
,
a
->
gotype
);
}
if
(
debug
[
'v'
]
||
debug
[
'n'
])
Bprint
(
&
bso
,
"symsize = %ud
\n
"
,
symsize
);
Bflush
(
&
bso
);
}
void
asmsym
(
void
)
{
genasmsym
(
putsymb
);
}
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