Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
b9c7ee5c
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b9c7ee5c
编写于
3月 31, 2013
作者:
B
bors
浏览文件
操作
浏览文件
下载
差异文件
auto merge of #5647 : thestinger/rust/execstack, r=brson
Closes #5643
上级
f336afd4
c0be7df5
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
94 addition
and
24 deletion
+94
-24
mk/platform.mk
mk/platform.mk
+3
-5
src/rt/arch/arm/_context.S
src/rt/arch/arm/_context.S
+9
-4
src/rt/arch/arm/ccall.S
src/rt/arch/arm/ccall.S
+5
-1
src/rt/arch/arm/morestack.S
src/rt/arch/arm/morestack.S
+5
-0
src/rt/arch/arm/record_sp.S
src/rt/arch/arm/record_sp.S
+8
-3
src/rt/arch/i386/_context.S
src/rt/arch/i386/_context.S
+5
-0
src/rt/arch/i386/ccall.S
src/rt/arch/i386/ccall.S
+5
-0
src/rt/arch/i386/morestack.S
src/rt/arch/i386/morestack.S
+8
-3
src/rt/arch/i386/record_sp.S
src/rt/arch/i386/record_sp.S
+4
-0
src/rt/arch/mips/_context.S
src/rt/arch/mips/_context.S
+5
-0
src/rt/arch/mips/ccall.S
src/rt/arch/mips/ccall.S
+5
-0
src/rt/arch/mips/record_sp.S
src/rt/arch/mips/record_sp.S
+5
-0
src/rt/arch/x86_64/_context.S
src/rt/arch/x86_64/_context.S
+10
-5
src/rt/arch/x86_64/ccall.S
src/rt/arch/x86_64/ccall.S
+6
-1
src/rt/arch/x86_64/morestack.S
src/rt/arch/x86_64/morestack.S
+7
-2
src/rt/arch/x86_64/record_sp.S
src/rt/arch/x86_64/record_sp.S
+4
-0
未找到文件。
mk/platform.mk
浏览文件 @
b9c7ee5c
...
...
@@ -61,8 +61,6 @@ ifdef CFG_VALGRIND
endif
ifneq
($(findstring linux,$(CFG_OSTYPE)),)
# -znoexecstack is here because librt is for some reason being created
# with executable stack and Fedora (or SELinux) doesn't like that (#798)
ifdef
CFG_PERF
ifneq
($(CFG_PERF_WITH_LOGFD),)
CFG_PERF_TOOL
:=
$(CFG_PERF)
stat
-r
3
--log-fd
2
...
...
@@ -126,7 +124,7 @@ CFG_GCCISH_CXXFLAGS_x86_64-unknown-linux-gnu := -fno-rtti
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-linux-gnu
:=
-shared
-fPIC
-ldl
-lpthread
-lrt
-g
-m64
CFG_GCCISH_DEF_FLAG_x86_64-unknown-linux-gnu
:=
-Wl
,--export-dynamic,--dynamic-list
=
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-linux-gnu
:=
-Wl
,-whole-archive
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu
:=
-Wl
,-no-whole-archive
-Wl
,-znoexecstack
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu
:=
-Wl
,-no-whole-archive
CFG_DEF_SUFFIX_x86_64-unknown-linux-gnu
:=
.linux.def
CFG_INSTALL_NAME_x86_64-unknown-linux-gnu
=
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-linux-gnu
=
...
...
@@ -152,7 +150,7 @@ CFG_GCCISH_CXXFLAGS_i686-unknown-linux-gnu := -fno-rtti
CFG_GCCISH_LINK_FLAGS_i686-unknown-linux-gnu
:=
-shared
-fPIC
-ldl
-lpthread
-lrt
-g
-m32
CFG_GCCISH_DEF_FLAG_i686-unknown-linux-gnu
:=
-Wl
,--export-dynamic,--dynamic-list
=
CFG_GCCISH_PRE_LIB_FLAGS_i686-unknown-linux-gnu
:=
-Wl
,-whole-archive
CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu
:=
-Wl
,-no-whole-archive
-Wl
,-znoexecstack
CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu
:=
-Wl
,-no-whole-archive
CFG_DEF_SUFFIX_i686-unknown-linux-gnu
:=
.linux.def
CFG_INSTALL_NAME_i686-unknown-linux-gnu
=
CFG_LIBUV_LINK_FLAGS_i686-unknown-linux-gnu
=
...
...
@@ -228,7 +226,7 @@ CFG_GCCISH_CXXFLAGS_arm-linux-androideabi := -fno-rtti
CFG_GCCISH_LINK_FLAGS_arm-linux-androideabi
:=
-shared
-fPIC
-ldl
-g
-lm
-lsupc
++
-lgnustl_shared
CFG_GCCISH_DEF_FLAG_arm-linux-androideabi
:=
-Wl
,--export-dynamic,--dynamic-list
=
CFG_GCCISH_PRE_LIB_FLAGS_arm-linux-androideabi
:=
-Wl
,-whole-archive
CFG_GCCISH_POST_LIB_FLAGS_arm-linux-androideabi
:=
-Wl
,-no-whole-archive
-Wl
,-znoexecstack
CFG_GCCISH_POST_LIB_FLAGS_arm-linux-androideabi
:=
-Wl
,-no-whole-archive
CFG_DEF_SUFFIX_arm-linux-androideabi
:=
.android.def
CFG_INSTALL_NAME_arm-linux-androideabi
=
CFG_LIBUV_LINK_FLAGS_arm-linux-androideabi
=
...
...
src/rt/arch/arm/_context.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
.
text
.
code
32
.
arm
...
...
@@ -17,12 +22,12 @@ swap_registers:
str
r10
,
[
r0
,
#
40
]
str
r11
,
[
r0
,
#
44
]
str
r12
,
[
r0
,
#
48
]
str
sp
,
[
r0
,
#
52
]
str
sp
,
[
r0
,
#
52
]
str
lr
,
[
r0
,
#
56
]
mrs
r2
,
cpsr
str
r2
,
[
r0
,
#
64
]
ldr
r0
,
[
r1
,
#
0
]
ldr
r3
,
[
r1
,
#
12
]
...
...
@@ -35,10 +40,10 @@ swap_registers:
ldr
r10
,
[
r1
,
#
40
]
ldr
r11
,
[
r1
,
#
44
]
ldr
r12
,
[
r1
,
#
48
]
ldr
sp
,
[
r1
,
#
52
]
ldr
lr
,
[
r1
,
#
56
]
ldr
r2
,
[
r1
,
#
64
]
msr
cpsr_cxsf
,
r2
...
...
src/rt/arch/arm/ccall.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
.
text
.
code
32
.
arm
...
...
@@ -19,4 +24,3 @@ __morestack:
pop
{
r4
,
fp
,
lr
}
mov
pc
,
lr
.
fnend
src/rt/arch/arm/morestack.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
.
text
.
code
32
.
arm
...
...
src/rt/arch/arm/record_sp.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
.
text
.
code
32
.
arm
...
...
@@ -45,11 +50,12 @@ get_sp_limit:
get_sp
:
mov
r0
,
sp
mov
pc
,
lr
.
data
my_cpu
:
.
long
0
.
global
my_array
my_array
:
my_array
:
.
long
0
.
long
0
.
long
0
.
long
0
...
...
@@ -57,5 +63,4 @@ my_array:
.
long
0
.
long
0
.
long
0
.
long
0
.
end
src/rt/arch/i386/_context.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
.
text
/*
...
...
src/rt/arch/i386/ccall.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
/*
The
function
for
switching
to
the
C
stack
.
It
is
called
__morestack
because
gdb
allows
any
frame
with
that
name
to
...
...
src/rt/arch/i386/morestack.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
/*
__morestack
...
...
@@ -218,11 +223,11 @@ MORESTACK:
.
L
$bail
:
movl
32
(%
esp
),%
eax
inc
%
eax
addl
$
44
,
%
esp
popl
%
ebp
addl
$
4
+
8
,%
esp
jmpl
*%
eax
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
...
...
@@ -241,7 +246,7 @@ L_rust_get_task$stub:
L_upcall_new_stack
$stub
:
.
indirect_symbol
_upcall_new_stack
.
ascii
"\364\364\364\364\364"
L_upcall_del_stack
$stub
:
.
indirect_symbol
_upcall_del_stack
.
ascii
"\364\364\364\364\364"
...
...
src/rt/arch/i386/record_sp.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
src/rt/arch/mips/_context.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
.
text
.
globl
swap_registers
.
align
2
...
...
src/rt/arch/mips/ccall.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
.
text
.
globl
__morestack
...
...
src/rt/arch/mips/record_sp.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
.
text
.
globl
record_sp_limit
...
...
src/rt/arch/x86_64/_context.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
#include "regs.h"
#define ARG0 RUSTRT_ARG0_S
#define ARG1 RUSTRT_ARG1_S
.
text
/*
...
...
@@ -11,7 +16,7 @@ and Microsoft discussion at
http
://
msdn
.
microsoft
.
com
/
en
-
US
/
library
/
9z1stfyw
%
28v
=
VS
.
80
%
29
.
aspx
.
BOTH
CALLING
CONVENTIONS
Callee
save
registers
:
R12
--
R15
,
RDI
,
RSI
,
RBX
,
RBP
,
RSP
XMM0
--
XMM5
...
...
@@ -30,7 +35,7 @@ User flags have no specified role and are not preserved
across
calls
,
with
the
exception
of
DF
in
%
rFLAGS
,
which
must
be
clear
(
set
to
"forward"
direction
)
on
function
entry
and
return
.
MICROSOFT
CALLING
CONVENTIONS
Return
value
:
RAX
...
...
@@ -39,7 +44,7 @@ First four arguments:
RCX
,
RDX
,
R8
,
R9
XMM0
,
XMM1
,
XMM2
,
XMM3
*/
/*
Stores
current
registers
into
arg0
/
RCX
and
restores
registers
found
in
arg1
/
RDX
.
This
is
used
by
our
...
...
@@ -47,7 +52,7 @@ First four arguments:
registers
and
the
register
used
for
the
first
argument
.
Volatile
registers
in
general
ought
to
be
saved
by
the
caller
anyhow
.
*/
*/
#if defined(__APPLE__) || defined(_WIN32)
#define SWAP_REGISTERS _swap_registers
...
...
src/rt/arch/x86_64/ccall.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
/*
The
function
for
switching
to
the
C
stack
.
It
is
called
__morestack
because
gdb
allows
any
frame
with
that
name
to
...
...
@@ -10,7 +15,7 @@
#define ARG0 RUSTRT_ARG0_S
#define ARG1 RUSTRT_ARG1_S
#define ARG2 RUSTRT_ARG2_S
.
text
#if defined(__APPLE__) || defined(_WIN32)
...
...
src/rt/arch/x86_64/morestack.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
/*
__morestack
...
...
@@ -78,7 +83,7 @@ MORESTACK:
movq
%
r11
,
%
rdx
//
Size
of
stack
arguments
movq
%
rax
,
%
rsi
//
Address
of
stack
arguments
movq
%
r10
,
%
rdi
//
The
amount
of
stack
needed
#ifdef __APPLE__
call
UPCALL_NEW_STACK
#endif
...
...
@@ -132,7 +137,7 @@ MORESTACK:
popq
%
rax
//
Restore
the
return
value
popq
%
rbp
ret
.
cfi_endproc
#else
...
...
src/rt/arch/x86_64/record_sp.S
浏览文件 @
b9c7ee5c
//
Mark
stack
as
non
-
executable
#if defined(__linux__) && defined(__ELF__)
.
section
.
note.GNU
-
stack
,
""
,
@
progbits
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录