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
7ce1a4bd
Commit
7ce1a4bd
authored
Jul 23, 2011
by
Wei Guangjing
Committed by
Russ Cox
Jul 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ld: fixes .bss for ldpe
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/4794056
parent
2d972ad4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/cmd/ld/ldpe.c
src/cmd/ld/ldpe.c
+4
-0
No files found.
src/cmd/ld/ldpe.c
View file @
7ce1a4bd
...
@@ -222,6 +222,8 @@ ldpe(Biobuf *f, char *pkg, int64 len, char *pn)
...
@@ -222,6 +222,8 @@ ldpe(Biobuf *f, char *pkg, int64 len, char *pn)
s
->
type
=
SRODATA
;
s
->
type
=
SRODATA
;
break
;
break
;
case
IMAGE_SCN_CNT_UNINITIALIZED_DATA
|
IMAGE_SCN_MEM_READ
|
IMAGE_SCN_MEM_WRITE
:
//.bss
case
IMAGE_SCN_CNT_UNINITIALIZED_DATA
|
IMAGE_SCN_MEM_READ
|
IMAGE_SCN_MEM_WRITE
:
//.bss
s
->
type
=
SBSS
;
break
;
case
IMAGE_SCN_CNT_INITIALIZED_DATA
|
IMAGE_SCN_MEM_READ
|
IMAGE_SCN_MEM_WRITE
:
//.data
case
IMAGE_SCN_CNT_INITIALIZED_DATA
|
IMAGE_SCN_MEM_READ
|
IMAGE_SCN_MEM_WRITE
:
//.data
s
->
type
=
SDATA
;
s
->
type
=
SDATA
;
break
;
break
;
...
@@ -382,6 +384,8 @@ map(PeObj *obj, PeSect *sect)
...
@@ -382,6 +384,8 @@ map(PeObj *obj, PeSect *sect)
return
0
;
return
0
;
sect
->
base
=
mal
(
sect
->
sh
.
SizeOfRawData
);
sect
->
base
=
mal
(
sect
->
sh
.
SizeOfRawData
);
if
(
sect
->
sh
.
PointerToRawData
==
0
)
// .bss don't has data in object file.
return
0
;
werrstr
(
"short read"
);
werrstr
(
"short read"
);
if
(
Bseek
(
obj
->
f
,
obj
->
base
+
sect
->
sh
.
PointerToRawData
,
0
)
<
0
||
if
(
Bseek
(
obj
->
f
,
obj
->
base
+
sect
->
sh
.
PointerToRawData
,
0
)
<
0
||
Bread
(
obj
->
f
,
sect
->
base
,
sect
->
sh
.
SizeOfRawData
)
!=
sect
->
sh
.
SizeOfRawData
)
Bread
(
obj
->
f
,
sect
->
base
,
sect
->
sh
.
SizeOfRawData
)
!=
sect
->
sh
.
SizeOfRawData
)
...
...
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