Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
7431a316
Commit
7431a316
authored
Dec 08, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ld: re-add ELF symbol tables
R=iant CC=golang-dev
https://golang.org/cl/3506041
parent
0313ea80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
2 deletions
+41
-2
src/cmd/ld/symtab.c
src/cmd/ld/symtab.c
+41
-2
No files found.
src/cmd/ld/symtab.c
View file @
7431a316
...
...
@@ -61,7 +61,7 @@ putelfstr(char *s)
}
void
putelfsym
b
(
char
*
s
,
int
t
,
vlong
addr
,
vlong
size
,
int
ver
,
Sym
*
go
)
putelfsym
64
(
Sym
*
x
,
char
*
s
,
int
t
,
vlong
addr
,
vlong
size
,
int
ver
,
Sym
*
go
)
{
int
bind
,
type
,
shndx
,
stroff
;
...
...
@@ -95,9 +95,48 @@ putelfsymb(char *s, int t, vlong addr, vlong size, int ver, Sym *go)
void
asmelfsym64
(
void
)
{
// genasmsym(putelfsymb
64);
genasmsym
(
putelfsym
64
);
}
void
putelfsym32
(
Sym
*
x
,
char
*
s
,
int
t
,
vlong
addr
,
vlong
size
,
int
ver
,
Sym
*
go
)
{
int
bind
,
type
,
shndx
,
stroff
;
bind
=
STB_GLOBAL
;
switch
(
t
)
{
default:
return
;
case
'T'
:
type
=
STT_FUNC
;
shndx
=
elftextsh
+
0
;
break
;
case
'D'
:
type
=
STT_OBJECT
;
shndx
=
elftextsh
+
1
;
break
;
case
'B'
:
type
=
STT_OBJECT
;
shndx
=
elftextsh
+
2
;
break
;
}
stroff
=
putelfstr
(
s
);
LPUT
(
stroff
);
// string
LPUT
(
addr
);
LPUT
(
size
);
cput
((
bind
<<
4
)
|
(
type
&
0xF
));
cput
(
0
);
WPUT
(
shndx
);
}
void
asmelfsym32
(
void
)
{
genasmsym
(
putelfsym32
);
}
static
Sym
*
symt
;
static
void
...
...
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