vmlinux 转换为 vmlinux.elf
Posted catoop
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vmlinux 转换为 vmlinux.elf相关的知识,希望对你有一定的参考价值。
使用工具 vmlinux-to-elf 直接转换即可
获取地址:https://github.com/marin-m/vmlinux-to-elf
我使用的是 Ubuntu (CentOS没试,按理说应该一样)
操作步骤如下:
sudo apt install python3-pip
sudo apt-get install git
sudo pip3 install --upgrade lz4 git+https://hub.fastgit.org/marin-m/vmlinux-to-elf
root@test-virtual-machine:/opt/ikuai-test# vmlinux-to-elf vmlinux vmlinux.elf
[+] Version string: Linux version 3.18.67 (test@xxx) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 unknown) ) #1 SMP Tue Oct 12 20:26:56 CST 2021
[+] Guessed architecture: mipsbe successfully in 3.44 seconds
[+] Found kallsyms_token_table at file offset 0x00b6a088
[+] Found kallsyms_token_index at file offset 0x00b6a3d0
[+] Found kallsyms_markers at file offset 0x00b69c60
[+] Found kallsyms_names at file offset 0x00b079b0
[+] Found kallsyms_num_syms at file offset 0x00b079a8
[i] Null addresses overall: 0.00591156 %
[+] Found kallsyms_addresses at file offset 0x00ac5868
[+] Successfully wrote the new ELF kernel to vmlinux.elf
因为访问 github.com 网络不好,所以我示例中使用了 hub.fastgit.org
至此 vmlinux.elf 文件生成。
(END)
以上是关于vmlinux 转换为 vmlinux.elf的主要内容,如果未能解决你的问题,请参考以下文章