1

我有一个Broadcom带有MPC8548EPowerPC 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 filereadelf -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

4

1 回答 1

1

看起来您的文件没有正确传输(通过 tftp),当文件被解析为 ELF 时会导致错误。

也许尝试在 tftp 服务器上运行数据包捕获,以检查 booloader 和服务器之间的流量。在 tftp 服务器上尝试这样的操作:

tcpdump -s 2048 -w tftp.pcap -i <interface> udp port tftp

tftp.pcap- 然后用wireshark打开生成的文件。

于 2017-02-03T01:40:05.680 回答