2017-01-27 73 views
1

我有一個Broadcom交換機板,其上有一個MPC8548E PowerPC CPU。我使用crosstool-ng爲這個CPU創建了一個工具鏈。當我嘗試使用CFE>引導裝載程序在此板上用命令load -elf 10.13.51.131:main加載編譯後的二進制,我得到下面的輸出:CFE引導加載程序中的ELF文件錯誤

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編譯運行,但是我也得到了同樣的錯誤。

這對於Broadcom參考板爲開關BCM956440

回答

1

看起來您的文件沒有被正確傳輸(通過tftp),導致文件被解析爲ELF時出錯。

也許嘗試在tftp服務器上運行數據包捕獲,以檢查booloader和服務器之間的流量。嘗試這樣的事情在TFTP服務器上:

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

- 然後打開生成的文件tftp.pcap使用Wireshark。