arm64执行错误
qaskyLujian opened this issue · comments
AnerLuzz commented
coolxv commented
执行下 readelf -h stub_test2,把结果发过来
还有你是在飞腾CPU的平台上编译后运行?还是在别的平台编译然后在飞腾CPU的平台上运行?
飞腾CPU是x86指令集?
# readelf -h main
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x4005c0
Start of program headers: 64 (bytes into file)
Start of section headers: 30664 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 9
Size of section headers: 64 (bytes)
Number of section headers: 35
Section header string table index: 34
AnerLuzz commented
coolxv commented
stub_test2代码上传下
AnerLuzz commented
coolxv commented
把被测代码写长点
void func()
{
printf("function func!");
printf("function func!");
printf("function func!");
}
AnerLuzz commented
AnerLuzz commented
经过多次尝试发现,打桩后执行延时操作可以解决。
coolxv commented
可能和流水线和缓存有关系
coolxv commented
可以参考下这篇文章 http://ele7enxxh.com/Android-Arm-Inline-Hook.html
平时开发不在ARM下,等有时间优化下。
coolxv commented
@qaskyLujian 已经修复arm cache问题
AnerLuzz commented
老师,相较于之前的版本是只增加了CACHEFLUSH吗?我加上后在飞腾2000平台上执行报错(系统是kylin)。报总线错误。
coolxv commented
@qaskyLujian 是的,linux下使用的GCC内置的函数,你使用的GCC版本不知道是否支持?