比较vmlinux和ddr.bin种text段:
1.取vmlinux中的数据,
count=(readelf -S vmlinux 中.text.size)/1024 = 0x0000000000c83c70/1024 = 12815;
skip=(readelf -S vmlinux 中.text.offset)/1024 = 0x00010800/1024 = 66;
dd if=vmlinux bs=1024 count=12815 skip=66 of=vmlinux_txt
2.取ddr中的数据,
count同上
skip=((vtop 0xffffff8008080000)-ddr.bin@offset)/1024 = (0x1080000 - 0x1000000)/1024 = 514;
dd if=ddr.bin bs=1024 count=12815 skip=514 of=ddr_txt
比较下来很多处不一样,没有关系,个人理解是编译器的原因,导致vmlinux和ddr有些指令不一样。
汇编 二进制
ddr中: ldtrh w20, [x25] 34 0b 40 78
vmlinux中: ldrh w20,[x25] 34 03 40 79
ldtr w20, [x23] f4 0a 40 b8
ldr w20,[x23] f4 02 40 b9
mrs x0, tpidr_el2 40 d0 3c d5
mrs x0,#0x3,#0x0,c13,c0,#0x4 80 d0 38 d5