Compare commits
1 Commits
fix/strlen
...
fix/#8
Author | SHA1 | Date | |
---|---|---|---|
24c38957f4 |
5
link.x
5
link.x
@@ -30,7 +30,10 @@ SECTIONS {
|
|||||||
*(data)
|
*(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
.bss ALIGN(16) : {*(.bss)}
|
.bss ALIGN(16) : {
|
||||||
|
*(.bss)
|
||||||
|
*(.bss.*)
|
||||||
|
}
|
||||||
|
|
||||||
FILE_END = .;
|
FILE_END = .;
|
||||||
}
|
}
|
||||||
|
@@ -31,12 +31,3 @@ pub unsafe extern "C" fn memcmp(s1: *mut u8, s2: *const u8, n: usize) -> i32 {
|
|||||||
|
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
pub unsafe extern "C" fn strlen(str: *mut u8) -> usize {
|
|
||||||
let mut len = 0usize;
|
|
||||||
loop {
|
|
||||||
if *str.add(len) == 0 { return len; }
|
|
||||||
len += 1;
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user