Skip to content

Commit 510839a

Browse files
committed
---
yaml --- r: 50424 b: refs/heads/auto c: c0be7df h: refs/heads/master v: v3
1 parent df80a08 commit 510839a

File tree

18 files changed

+97
-40
lines changed

18 files changed

+97
-40
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: fb5f020cc2d1d0972d2726413d1ec053990675ad
17+
refs/heads/auto: c0be7df5de2d5b5137f66743a428d1843b98ba9b
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167

branches/auto/mk/platform.mk

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ ifdef CFG_VALGRIND
6161
endif
6262

6363
ifneq ($(findstring linux,$(CFG_OSTYPE)),)
64-
# -znoexecstack is here because librt is for some reason being created
65-
# with executable stack and Fedora (or SELinux) doesn't like that (#798)
6664
ifdef CFG_PERF
6765
ifneq ($(CFG_PERF_WITH_LOGFD),)
6866
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
126124
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-linux-gnu := -shared -fPIC -ldl -lpthread -lrt -g -m64
127125
CFG_GCCISH_DEF_FLAG_x86_64-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
128126
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-whole-archive
129-
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-no-whole-archive -Wl,-znoexecstack
127+
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-no-whole-archive
130128
CFG_DEF_SUFFIX_x86_64-unknown-linux-gnu := .linux.def
131129
CFG_INSTALL_NAME_x86_64-unknown-linux-gnu =
132130
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-linux-gnu =
@@ -152,7 +150,7 @@ CFG_GCCISH_CXXFLAGS_i686-unknown-linux-gnu := -fno-rtti
152150
CFG_GCCISH_LINK_FLAGS_i686-unknown-linux-gnu := -shared -fPIC -ldl -lpthread -lrt -g -m32
153151
CFG_GCCISH_DEF_FLAG_i686-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
154152
CFG_GCCISH_PRE_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-whole-archive
155-
CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-no-whole-archive -Wl,-znoexecstack
153+
CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-no-whole-archive
156154
CFG_DEF_SUFFIX_i686-unknown-linux-gnu := .linux.def
157155
CFG_INSTALL_NAME_i686-unknown-linux-gnu =
158156
CFG_LIBUV_LINK_FLAGS_i686-unknown-linux-gnu =
@@ -228,7 +226,7 @@ CFG_GCCISH_CXXFLAGS_arm-linux-androideabi := -fno-rtti
228226
CFG_GCCISH_LINK_FLAGS_arm-linux-androideabi := -shared -fPIC -ldl -g -lm -lsupc++ -lgnustl_shared
229227
CFG_GCCISH_DEF_FLAG_arm-linux-androideabi := -Wl,--export-dynamic,--dynamic-list=
230228
CFG_GCCISH_PRE_LIB_FLAGS_arm-linux-androideabi := -Wl,-whole-archive
231-
CFG_GCCISH_POST_LIB_FLAGS_arm-linux-androideabi := -Wl,-no-whole-archive -Wl,-znoexecstack
229+
CFG_GCCISH_POST_LIB_FLAGS_arm-linux-androideabi := -Wl,-no-whole-archive
232230
CFG_DEF_SUFFIX_arm-linux-androideabi := .android.def
233231
CFG_INSTALL_NAME_arm-linux-androideabi =
234232
CFG_LIBUV_LINK_FLAGS_arm-linux-androideabi =

branches/auto/src/libcore/str.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,10 +1865,8 @@ pub struct CharRange {
18651865
* Given a byte position and a str, return the previous char and its position
18661866
*
18671867
* This function can be used to iterate over a unicode string in reverse.
1868-
*
1869-
* returns 0 for next index if called on start index 0
18701868
*/
1871-
pub fn char_range_at_reverse(ss: &str, start: uint) -> CharRange {
1869+
fn char_range_at_reverse(ss: &str, start: uint) -> CharRange {
18721870
let mut prev = start;
18731871

18741872
// while there is a previous byte == 10......
@@ -1877,12 +1875,7 @@ pub fn char_range_at_reverse(ss: &str, start: uint) -> CharRange {
18771875
}
18781876

18791877
// now refer to the initial byte of previous char
1880-
if prev > 0u {
1881-
prev -= 1u;
1882-
} else {
1883-
prev = 0u;
1884-
}
1885-
1878+
prev -= 1u;
18861879

18871880
let ch = char_at(ss, prev);
18881881
return CharRange {ch:ch, next:prev};
@@ -3768,10 +3761,4 @@ mod tests {
37683761
"12345555".cmp(& &"123456") == Less;
37693762
"22".cmp(& &"1234") == Greater;
37703763
}
3771-
3772-
#[test]
3773-
fn test_char_range_at_reverse_underflow() {
3774-
assert!(char_range_at_reverse("abc", 0).next == 0);
3775-
}
3776-
37773764
}

branches/auto/src/rt/arch/arm/_context.S

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27
.code 32
38
.arm
@@ -17,12 +22,12 @@ swap_registers:
1722
str r10, [r0, #40]
1823
str r11, [r0, #44]
1924
str r12, [r0, #48]
20-
str sp, [r0, #52]
25+
str sp, [r0, #52]
2126
str lr, [r0, #56]
2227

2328
mrs r2, cpsr
2429
str r2, [r0, #64]
25-
30+
2631

2732
ldr r0, [r1, #0]
2833
ldr r3, [r1, #12]
@@ -35,10 +40,10 @@ swap_registers:
3540
ldr r10, [r1, #40]
3641
ldr r11, [r1, #44]
3742
ldr r12, [r1, #48]
38-
43+
3944
ldr sp, [r1, #52]
4045
ldr lr, [r1, #56]
41-
46+
4247
ldr r2, [r1, #64]
4348
msr cpsr_cxsf, r2
4449

branches/auto/src/rt/arch/arm/ccall.S

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27
.code 32
38
.arm
@@ -19,4 +24,3 @@ __morestack:
1924
pop {r4, fp, lr}
2025
mov pc, lr
2126
.fnend
22-

branches/auto/src/rt/arch/arm/morestack.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27
.code 32
38
.arm

branches/auto/src/rt/arch/arm/record_sp.S

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27
.code 32
38
.arm
@@ -45,17 +50,17 @@ get_sp_limit:
4550
get_sp:
4651
mov r0, sp
4752
mov pc, lr
48-
53+
4954
.data
5055
my_cpu: .long 0
5156
.global my_array
52-
my_array:
57+
my_array:
58+
.long 0
5359
.long 0
5460
.long 0
5561
.long 0
5662
.long 0
5763
.long 0
5864
.long 0
5965
.long 0
60-
.long 0
6166
.end

branches/auto/src/rt/arch/i386/_context.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27

38
/*

branches/auto/src/rt/arch/i386/ccall.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
/*
27
The function for switching to the C stack. It is called
38
__morestack because gdb allows any frame with that name to

branches/auto/src/rt/arch/i386/morestack.S

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
/*
27
__morestack
38
@@ -218,11 +223,11 @@ MORESTACK:
218223
.L$bail:
219224
movl 32(%esp),%eax
220225
inc %eax
221-
226+
222227
addl $44, %esp
223228
popl %ebp
224229
addl $4+8,%esp
225-
230+
226231
jmpl *%eax
227232

228233
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
@@ -241,7 +246,7 @@ L_rust_get_task$stub:
241246
L_upcall_new_stack$stub:
242247
.indirect_symbol _upcall_new_stack
243248
.ascii "\364\364\364\364\364"
244-
249+
245250
L_upcall_del_stack$stub:
246251
.indirect_symbol _upcall_del_stack
247252
.ascii "\364\364\364\364\364"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif

branches/auto/src/rt/arch/mips/_context.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27
.globl swap_registers
38
.align 2

branches/auto/src/rt/arch/mips/ccall.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27

38
.globl __morestack

branches/auto/src/rt/arch/mips/record_sp.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27

38
.globl record_sp_limit

branches/auto/src/rt/arch/x86_64/_context.S

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
#include "regs.h"
27
#define ARG0 RUSTRT_ARG0_S
38
#define ARG1 RUSTRT_ARG1_S
4-
9+
510
.text
611

712
/*
@@ -11,7 +16,7 @@ and Microsoft discussion at
1116
http://msdn.microsoft.com/en-US/library/9z1stfyw%28v=VS.80%29.aspx.
1217
1318
BOTH CALLING CONVENTIONS
14-
19+
1520
Callee save registers:
1621
R12--R15, RDI, RSI, RBX, RBP, RSP
1722
XMM0--XMM5
@@ -30,7 +35,7 @@ User flags have no specified role and are not preserved
3035
across calls, with the exception of DF in %rFLAGS,
3136
which must be clear (set to "forward" direction)
3237
on function entry and return.
33-
38+
3439
MICROSOFT CALLING CONVENTIONS
3540
3641
Return value: RAX
@@ -39,15 +44,15 @@ First four arguments:
3944
RCX, RDX, R8, R9
4045
XMM0, XMM1, XMM2, XMM3
4146
*/
42-
47+
4348
/*
4449
Stores current registers into arg0/RCX and restores
4550
registers found in arg1/RDX. This is used by our
4651
implementation of getcontext. Only saves/restores nonvolatile
4752
registers and the register used for the first argument.
4853
Volatile registers in general ought to be saved by the caller
4954
anyhow.
50-
*/
55+
*/
5156

5257
#if defined(__APPLE__) || defined(_WIN32)
5358
#define SWAP_REGISTERS _swap_registers

branches/auto/src/rt/arch/x86_64/ccall.S

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
/*
27
The function for switching to the C stack. It is called
38
__morestack because gdb allows any frame with that name to
@@ -10,7 +15,7 @@
1015
#define ARG0 RUSTRT_ARG0_S
1116
#define ARG1 RUSTRT_ARG1_S
1217
#define ARG2 RUSTRT_ARG2_S
13-
18+
1419
.text
1520

1621
#if defined(__APPLE__) || defined(_WIN32)

branches/auto/src/rt/arch/x86_64/morestack.S

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
/*
27
__morestack
38
@@ -78,7 +83,7 @@ MORESTACK:
7883
movq %r11, %rdx // Size of stack arguments
7984
movq %rax, %rsi // Address of stack arguments
8085
movq %r10, %rdi // The amount of stack needed
81-
86+
8287
#ifdef __APPLE__
8388
call UPCALL_NEW_STACK
8489
#endif
@@ -132,7 +137,7 @@ MORESTACK:
132137
popq %rax // Restore the return value
133138
popq %rbp
134139
ret
135-
140+
136141
.cfi_endproc
137142

138143
#else
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif

0 commit comments

Comments
 (0)