我在Ubuntu14.04上为ARM平台构建了一个共享库。该文件已成功编译和生成。我可以使用nm命令检查导出的符号,但是当我检查.so文件头时,我得到了架构未知的信息。
这个库的构建是否正确,为什么库体系结构不为人所知?
objdump -f libMyLib.so
libMyLib.so: file format elf32-little
architecture: UNKNOWN!, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x000033a0发布于 2021-04-10 00:37:59
您需要使用目标系统(ARM)的工具链(ARM)提供的objdump二进制文件,而不是来自主机系统(X86_64)的二进制文件。
举个例子:我已经建立了一个针对openwrt的主机系统Linux x86_64,我的工具链文件夹有一些文件:
mips-openwrt-linux-gnu-ar
mips-openwrt-linux-gnu-as
mips-openwrt-linux-gnu-gcc
mips-openwrt-linux-gnu-ld
mips-openwrt-linux-gnu-objdump
mips-openwrt-linux-gnu-nm这些是操作openwrt系统程序的工具,所以我需要调用./mips-openwrt-linux-gnu-objdump -f <bin file>来读取并获得编译文件的适当输出,而不是仅仅调用objdump。
https://stackoverflow.com/questions/39746465
复制相似问题