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
f997bc6e
Commit
f997bc6e
authored
Jun 18, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack offseet table marker
tacked above each TEXT entry SVN=123496
parent
543226e8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
4 deletions
+26
-4
src/cmd/6l/6.out.h
src/cmd/6l/6.out.h
+1
-0
src/cmd/6l/asm.c
src/cmd/6l/asm.c
+2
-1
src/cmd/6l/l.h
src/cmd/6l/l.h
+1
-0
src/cmd/6l/obj.c
src/cmd/6l/obj.c
+3
-1
src/cmd/6l/optab.c
src/cmd/6l/optab.c
+1
-1
src/cmd/6l/span.c
src/cmd/6l/span.c
+18
-1
No files found.
src/cmd/6l/6.out.h
View file @
f997bc6e
...
...
@@ -32,6 +32,7 @@
#define NSNAME 8
#define NOPROF (1<<0)
#define DUPOK (1<<1)
#define SOFmark (11)
/*
* amd64
...
...
src/cmd/6l/asm.c
View file @
f997bc6e
...
...
@@ -138,7 +138,8 @@ asmb(void)
for
(
p
=
firstp
;
p
!=
P
;
p
=
p
->
link
)
{
if
(
p
->
as
==
ATEXT
)
curtext
=
p
;
if
(
p
->
pc
!=
pc
)
{
if
(
p
->
pc
!=
pc
)
if
(
p
->
as
!=
ATEXT
||
p
->
pc
!=
pc
+
SOFmark
)
{
if
(
!
debug
[
'a'
])
print
(
"%P
\n
"
,
curp
);
diag
(
"phase error %llux sb %llux in %s"
,
p
->
pc
,
pc
,
TNAME
);
...
...
src/cmd/6l/l.h
View file @
f997bc6e
...
...
@@ -217,6 +217,7 @@ enum
Zaut_r
,
Zo_m
,
Zo_m64
,
Ztext
,
Zpseudo
,
Zr_m
,
Zr_m_xm
,
...
...
src/cmd/6l/obj.c
View file @
f997bc6e
...
...
@@ -925,7 +925,9 @@ loop:
sig
=
1729
;
if
(
sig
!=
0
){
if
(
s
->
sig
!=
0
&&
s
->
sig
!=
sig
)
diag
(
"incompatible type signatures %lux(%s) and %lux(%s) for %s"
,
s
->
sig
,
filen
[
s
->
file
],
sig
,
pn
,
s
->
name
);
diag
(
"incompatible type signatures %lux(%s)"
"and %lux(%s) for %s"
,
s
->
sig
,
filen
[
s
->
file
],
sig
,
pn
,
s
->
name
);
s
->
sig
=
sig
;
s
->
file
=
files
-
1
;
}
...
...
src/cmd/6l/optab.c
View file @
f997bc6e
...
...
@@ -37,7 +37,7 @@ uchar ynone[] =
};
uchar
ytext
[]
=
{
Ymb
,
Yi32
,
Z
pseudo
,
1
,
Ymb
,
Yi32
,
Z
text
,
1
,
0
};
uchar
ynop
[]
=
...
...
src/cmd/6l/span.c
View file @
f997bc6e
...
...
@@ -83,6 +83,8 @@ start:
p
->
pc
=
c
;
asmins
(
p
);
p
->
pc
=
c
;
if
(
p
->
as
==
ATEXT
)
p
->
pc
+=
SOFmark
;
// skip the stack marker
m
=
andptr
-
and
;
p
->
mark
=
m
;
c
+=
m
;
...
...
@@ -113,6 +115,8 @@ loop:
}
}
p
->
pc
=
c
;
if
(
p
->
as
==
ATEXT
)
p
->
pc
+=
SOFmark
;
// skip the stack marker
c
+=
p
->
mark
;
}
if
(
again
)
{
...
...
@@ -269,7 +273,7 @@ asmlc(void)
Prog
*
p
;
long
oldlc
,
v
,
s
;
oldpc
=
INITTEXT
;
oldpc
=
INITTEXT
+
SOFmark
;
oldlc
=
0
;
for
(
p
=
firstp
;
p
!=
P
;
p
=
p
->
link
)
{
if
(
p
->
line
==
oldlc
||
p
->
as
==
ATEXT
||
p
->
as
==
ANOP
)
{
...
...
@@ -1120,6 +1124,19 @@ found:
diag
(
"asmins: unknown z %d %P"
,
t
[
2
],
p
);
return
;
case
Ztext
:
v
=
p
->
to
.
offset
;
if
(
v
<
0
)
v
=
0
;
// eleven bytes of buried stack offset
*
andptr
++
=
v
>>
3
;
*
andptr
++
=
v
>>
11
;
*
andptr
++
=
v
>>
19
;
for
(
v
=
0
;
v
<
SOFmark
-
3
;
v
++
)
*
andptr
++
=
"
\xa7\xf1\xd9\x2a\x82\xc8\xd8\xfe
"
[
v
];
break
;
case
Zpseudo
:
break
;
...
...
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