未验证 提交 dd23deb5 编写于 作者: O openharmony_ci 提交者: Gitee

!862 adapt:arm64适配后向CFI功能

Merge pull request !862 from Zhaotianyu/20230409backwardcfi
......@@ -1883,6 +1883,7 @@ musl_inc_sys_files = [
"include/sys/signal.h",
"include/sys/socket.h",
"include/sys/soundcard.h",
"include/sys/sspret.h",
"include/sys/statfs.h",
"include/sys/stat.h",
"include/sys/statvfs.h",
......@@ -2045,6 +2046,7 @@ musl_src_porting_file = [
"include/stdlib.h",
"include/string.h",
"include/sys/stat.h",
"include/sys/sspret.h",
"include/fortify/fcntl.h",
"include/fortify/fortify.h",
"include/fortify/poll.h",
......
#ifndef _SSPRET_H
#define _SSPRET_H
#if defined(__SSP_RET_STRONG__) || defined(__SSP_RET_ALL__)
#if defined(__aarch64__)
# define SSPRET_CALC_RETCOOKIE(reg) \
eor reg, reg, x30
# define SSPRET_LOAD_COOKIE(x, reg) \
mov reg, x29
# define SSPRET_SETUP(x, reg) \
SSPRET_LOAD_COOKIE(x, reg); \
SSPRET_CALC_RETCOOKIE(reg)
# define SSPRET_CHECK(x, reg) \
SSPRET_LOAD_COOKIE(x, x9); \
SSPRET_CALC_RETCOOKIE(x9); \
subs reg, reg, x9; \
cbz reg, 6788f; \
brk #0x1; \
6788:
# define SSPRET_PUSH(reg) \
str reg, [sp, #-16]!
# define SSPRET_POP(reg) \
ldr reg, [sp, #16]!
#endif /* __aarch64__ */
#else
# define SSPRET_CALC_RETCOOKIE(reg)
# define SSPRET_LOAD_COOKIE(x, reg)
# define SSPRET_SETUP(x, reg)
# define SSPRET_CHECK(x, reg)
# define SSPRET_PUSH(reg)
# define SSPRET_POP(reg)
#endif /* __SSP_RET_STRONG__ || __SSP_RET_ALL__ */
#endif /* _SSPRET_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册