提交 bc4fd32f 编写于 作者: D dhy308

Add logs and fix libtest compile issue in arm64

Issue: I6A9R5
Test: libc-test pass
Signed-off-by: Ndhy308 <tony.gan@huawei.com>
上级 14eb92fe
...@@ -358,8 +358,8 @@ void cfi_unmap_dso_from_cfi_shadow_002(void) ...@@ -358,8 +358,8 @@ void cfi_unmap_dso_from_cfi_shadow_002(void)
{ {
printf("["__FILE__"][Line: %d][%s]: entry\n", __LINE__, __func__); printf("["__FILE__"][Line: %d][%s]: entry\n", __LINE__, __func__);
struct dso test_dso = {}; struct dso test_dso = {};
int a = 9; unsigned char a = 'S';
test_dso.map = (unsigned char *)a; test_dso.map = &a;
test_dso.map_len = 0; test_dso.map_len = 0;
unmap_dso_from_cfi_shadow(&test_dso); unmap_dso_from_cfi_shadow(&test_dso);
printf("["__FILE__"][Line: %d][%s]: end\n", __LINE__, __func__); printf("["__FILE__"][Line: %d][%s]: end\n", __LINE__, __func__);
......
...@@ -176,8 +176,9 @@ static uintptr_t get_cfi_check_addr(uint16_t value, void* func_ptr) ...@@ -176,8 +176,9 @@ static uintptr_t get_cfi_check_addr(uint16_t value, void* func_ptr)
LD_LOGD("[CFI] [%{public}s] __arm__ defined!\n", __FUNCTION__); LD_LOGD("[CFI] [%{public}s] __arm__ defined!\n", __FUNCTION__);
cfi_check_func_addr++; cfi_check_func_addr++;
#endif #endif
LD_LOGI("[CFI] [%{public}s] the cfi_check_func_addr is %{public}p!\n", __FUNCTION__, cfi_check_func_addr); LD_LOGI("[CFI] [%{public}s] cfi_check_func_addr[%{public}p]\n", __FUNCTION__, cfi_check_func_addr);
LD_LOGD("[CFI] [%{public}s] __cfi_check is in dso[%{public}s]\n", __FUNCTION__,
((struct dso *)addr2dso((size_t)cfi_check_func_addr))->name);
return cfi_check_func_addr; return cfi_check_func_addr;
} }
...@@ -490,18 +491,24 @@ static int fill_shadow_value_to_shadow(uintptr_t begin, uintptr_t end, uintptr_t ...@@ -490,18 +491,24 @@ static int fill_shadow_value_to_shadow(uintptr_t begin, uintptr_t end, uintptr_t
void __cfi_slowpath(uint64_t call_site_type_id, void *func_ptr) void __cfi_slowpath(uint64_t call_site_type_id, void *func_ptr)
{ {
LD_LOGD("[CFI] [%{public}s] start!\n", __FUNCTION__); LD_LOGD("[CFI] [%{public}s] called from dso[%{public}s] to dso[%{public}s] func_ptr[%{public}p]\n",
__FUNCTION__,
((struct dso *)addr2dso((size_t)__builtin_return_address(0)))->name,
((struct dso *)addr2dso((size_t)func_ptr))->name,
func_ptr);
cfi_slowpath_common(call_site_type_id, func_ptr, NULL); cfi_slowpath_common(call_site_type_id, func_ptr, NULL);
return; return;
} }
void __cfi_slowpath_diag(uint64_t call_site_type_id, void *func_ptr, void *diag_data) void __cfi_slowpath_diag(uint64_t call_site_type_id, void *func_ptr, void *diag_data)
{ {
LD_LOGD("[CFI] [%{public}s] start!\n", __FUNCTION__); LD_LOGD("[CFI] [%{public}s] called from dso[%{public}s] to dso[%{public}s] func_ptr[%{public}p]\n",
__FUNCTION__,
((struct dso *)addr2dso((size_t)__builtin_return_address(0)))->name,
((struct dso *)addr2dso((size_t)func_ptr))->name,
func_ptr);
cfi_slowpath_common(call_site_type_id, func_ptr, diag_data); cfi_slowpath_common(call_site_type_id, func_ptr, diag_data);
return; return;
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册