提交 d1fc9d52 编写于 作者: O openharmony_ci 提交者: Gitee

!106 解决堆栈保护问题和riscv32_virt网络驱动开发

Merge pull request !106 from xiexg/riscv32-virt
...@@ -47,6 +47,7 @@ static_library(libc) { ...@@ -47,6 +47,7 @@ static_library(libc) {
"src/ctype/isxdigit.c", "src/ctype/isxdigit.c",
"src/ctype/tolower.c", "src/ctype/tolower.c",
"src/ctype/toupper.c", "src/ctype/toupper.c",
"src/env/__stack_chk_fail.c",
"src/errno/strerror.c", "src/errno/strerror.c",
"src/exit/abort.c", "src/exit/abort.c",
"src/exit/assert.c", "src/exit/assert.c",
......
#include <string.h>
#include <stdint.h>
#include "pthread_impl.h"
uintptr_t __stack_chk_guard;
void __init_ssp(void *entropy)
{
if (entropy) memcpy(&__stack_chk_guard, entropy, sizeof(uintptr_t));
else __stack_chk_guard = (uintptr_t)&__stack_chk_guard * 1103515245;
}
void __stack_chk_fail(void)
{
*(volatile char *)0=0;
}
hidden void __stack_chk_fail_local(void);
weak_alias(__stack_chk_fail, __stack_chk_fail_local);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册