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
1a9a6396
Commit
1a9a6396
authored
Jan 12, 2013
by
Anthony Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/5l: fix invalid executable header on Plan 9
R=minux.ma, lucio.dere CC=golang-dev
https://golang.org/cl/7094048
parent
c13866db
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
asm.c
src/cmd/5l/asm.c
+22
-4
l.h
src/cmd/5l/l.h
+0
-1
No files found.
src/cmd/5l/asm.c
View file @
1a9a6396
...
...
@@ -490,6 +490,8 @@ asmb(void)
int32
t
;
uint32
symo
;
Section
*
sect
;
Sym
*
sym
;
int
i
;
if
(
debug
[
'v'
])
Bprint
(
&
bso
,
"%5.2f asmb
\n
"
,
cputime
());
...
...
@@ -546,6 +548,8 @@ asmb(void)
break
;
}
cseek
(
symo
);
switch
(
HEADTYPE
)
{
default:
if
(
iself
)
{
if
(
debug
[
'v'
])
Bprint
(
&
bso
,
"%5.2f elfsym
\n
"
,
cputime
());
...
...
@@ -557,8 +561,22 @@ asmb(void)
Bprint
(
&
bso
,
"%5.2f dwarf
\n
"
,
cputime
());
dwarfemitdebugsections
();
}
break
;
case
Hplan9x32
:
asmplan9sym
();
cflush
();
sym
=
lookup
(
"pclntab"
,
0
);
if
(
sym
!=
nil
)
{
lcsize
=
sym
->
np
;
for
(
i
=
0
;
i
<
lcsize
;
i
++
)
cput
(
sym
->
p
[
i
]);
cflush
();
}
break
;
}
}
cursym
=
nil
;
if
(
debug
[
'v'
])
...
...
@@ -581,7 +599,7 @@ asmb(void)
-
8
)
/
4
);
/* BL - entry code */
lputl
(
0xef000011
);
/* SWI - exit code */
lputl
(
textsize
+
HEADR
);
/* text size */
lputl
(
segtext
.
filelen
+
HEADR
);
/* text size */
lputl
(
segdata
.
filelen
);
/* data size */
lputl
(
0
);
/* sym size */
...
...
@@ -601,7 +619,7 @@ asmb(void)
break
;
case
Hplan9x32
:
/* plan 9 */
lput
(
0x647
);
/* magic */
lput
(
textsize
);
/* sizes */
lput
(
segtext
.
filelen
);
/* sizes */
lput
(
segdata
.
filelen
);
lput
(
segdata
.
len
-
segdata
.
filelen
);
lput
(
symsize
);
/* nsyms */
...
...
@@ -626,12 +644,12 @@ asmb(void)
}
cflush
();
if
(
debug
[
'c'
]){
print
(
"textsize=%d
\n
"
,
textsize
);
print
(
"textsize=%d
\n
"
,
segtext
.
filelen
);
print
(
"datsize=%ulld
\n
"
,
segdata
.
filelen
);
print
(
"bsssize=%ulld
\n
"
,
segdata
.
len
-
segdata
.
filelen
);
print
(
"symsize=%d
\n
"
,
symsize
);
print
(
"lcsize=%d
\n
"
,
lcsize
);
print
(
"total=%lld
\n
"
,
textsize
+
segdata
.
len
+
symsize
+
lcsize
);
print
(
"total=%lld
\n
"
,
segtext
.
filelen
+
segdata
.
len
+
symsize
+
lcsize
);
}
}
...
...
src/cmd/5l/l.h
View file @
1a9a6396
...
...
@@ -304,7 +304,6 @@ EXTERN char* rpath;
EXTERN
uint32
stroffset
;
EXTERN
int32
symsize
;
EXTERN
Sym
*
textp
;
EXTERN
int32
textsize
;
EXTERN
int
version
;
EXTERN
char
xcmp
[
C_GOK
+
1
][
C_GOK
+
1
];
EXTERN
Prog
zprg
;
...
...
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