Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mu-impl-fast
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
40
Issues
40
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
mu
mu-impl-fast
Commits
b904f808
Commit
b904f808
authored
Nov 08, 2016
by
qinsoon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for asm emit on linux, always call func@PLT
parent
7a8f7b45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
remote_test.sh
remote_test.sh
+1
-1
src/compiler/backend/arch/x86_64/asm_backend.rs
src/compiler/backend/arch/x86_64/asm_backend.rs
+19
-7
No files found.
remote_test.sh
View file @
b904f808
#!/bin/bash
echo
"rsync source to machine:
$1
..."
rsync
-avz
--exclude
'Cargo.lock'
--exclude
'*.log'
--exclude
'emit*'
--exclude
'target*'
--exclude
'.git'
.
$1
:~/mu/
rsync
-avz
--exclude
'Cargo.lock'
--exclude
'*.log'
--exclude
'emit*'
--exclude
'target*'
--exclude
'.git'
--exclude
'*__pycache__*'
.
$1
:~/mu/
echo
"executing tests..."
ssh
$1
"cd ~/mu; ./run_test.sh
$2
"
src/compiler/backend/arch/x86_64/asm_backend.rs
View file @
b904f808
...
...
@@ -2193,7 +2193,8 @@ impl CodeGenerator for ASMCodeGen {
let
asm
=
format!
(
"jle {}"
,
symbol
(
self
.mangle_block_label
(
dest_name
.clone
())));
self
.add_asm_branch2
(
asm
,
dest_name
);
}
#[cfg(target_os
=
"macos"
)]
fn
emit_call_near_rel32
(
&
mut
self
,
callsite
:
String
,
func
:
MuName
)
->
ValueLocation
{
trace!
(
"emit: call {}"
,
func
);
...
...
@@ -2206,6 +2207,23 @@ impl CodeGenerator for ASMCodeGen {
ValueLocation
::
Relocatable
(
RegGroup
::
GPR
,
callsite
)
}
#[cfg(target_os
=
"linux"
)]
// generating Position-Independent Code using PLT
fn
emit_call_near_rel32
(
&
mut
self
,
callsite
:
String
,
func
:
MuName
)
->
ValueLocation
{
trace!
(
"emit: call {}"
,
func
);
let
func
=
func
+
"@PLT"
;
let
asm
=
format!
(
"call {}"
,
symbol
(
func
));
self
.add_asm_call
(
asm
);
let
callsite_symbol
=
symbol
(
callsite
.clone
());
self
.add_asm_symbolic
(
directive_globl
(
callsite_symbol
.clone
()));
self
.add_asm_symbolic
(
format!
(
"{}:"
,
callsite_symbol
.clone
()));
ValueLocation
::
Relocatable
(
RegGroup
::
GPR
,
callsite
)
}
fn
emit_call_near_r64
(
&
mut
self
,
callsite
:
String
,
func
:
&
P
<
Value
>
)
->
ValueLocation
{
trace!
(
"emit: call {}"
,
func
);
...
...
@@ -2483,15 +2501,9 @@ pub fn emit_context(vm: &VM) {
debug!
(
"---finish---"
);
}
//#[cfg(target_os = "macos")]
fn
directive_globl
(
name
:
String
)
->
String
{
format!
(
".globl {}"
,
name
)
}
//
//#[cfg(target_os = "linux")]
//fn directive_globl(name: String) -> String {
// format!("global {}", name)
//}
fn
directive_comm
(
name
:
String
,
size
:
ByteSize
,
align
:
ByteSize
)
->
String
{
format!
(
".comm {},{},{}"
,
name
,
size
,
align
)
...
...
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