我有一个Broadcom
带有MPC8548E
PowerPC CPU 的开关板。我已经为这个 CPU 创建了一个工具链,使用crosstool-ng
. 当我尝试使用CFE>
该板上的引导加载程序使用命令加载编译的二进制文件时load -elf 10.13.51.131:main
,我得到以下输出:
CFE> load -elf 10.13.51.131:main
Loader:elf Filesys:tftp Dev:eth0 File:10.13.51.131:main Options:(null)
Loading: Warning: negative seek on tftp file attempted
Failed.
Could not load 10.13.51.131:main: Invalid ELF file
*** command status = -16
为什么会说Invalid ELF file
?readelf -h
向我显示以下信息:
$ readelf -h main
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: PowerPC
Version: 0x1
Entry point address: 0x100002c8
Start of program headers: 52 (bytes into file)
Start of section headers: 3972 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 7
Size of section headers: 40 (bytes)
Number of section headers: 28
Section header string table index: 25
如何加载 ELF 文件,我什至不想运行任何东西,它首先需要接受 ELF。我有另一个 ELF(据说)准备好使用 VxWorks 编译运行,但使用那个 ELF 时我也遇到了同样的错误。
这为Broadcom
交换机的参考板BCM956440
。