提交 f518d827 编写于 作者: A arvinzzz

Support backward cfi ability for asm file

 Issue: #I6U3D6
 Test: cfi demo pass
Signed-off-by: Narvinzzz <zhaotianyu9@huawei.com>
Change-Id: Ia9dbfdf18952b614cfed4a97e6366ee9cb8dedce
上级 3bb6a7c2
...@@ -1883,6 +1883,7 @@ musl_inc_sys_files = [ ...@@ -1883,6 +1883,7 @@ musl_inc_sys_files = [
"include/sys/signal.h", "include/sys/signal.h",
"include/sys/socket.h", "include/sys/socket.h",
"include/sys/soundcard.h", "include/sys/soundcard.h",
"include/sys/sspret.h",
"include/sys/statfs.h", "include/sys/statfs.h",
"include/sys/stat.h", "include/sys/stat.h",
"include/sys/statvfs.h", "include/sys/statvfs.h",
...@@ -2045,6 +2046,7 @@ musl_src_porting_file = [ ...@@ -2045,6 +2046,7 @@ musl_src_porting_file = [
"include/stdlib.h", "include/stdlib.h",
"include/string.h", "include/string.h",
"include/sys/stat.h", "include/sys/stat.h",
"include/sys/sspret.h",
"include/fortify/fcntl.h", "include/fortify/fcntl.h",
"include/fortify/fortify.h", "include/fortify/fortify.h",
"include/fortify/poll.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.
先完成此消息的编辑!
想要评论请 注册