I have a Broadcom switch board with a MPC8548E PowerPC CPU on it. I have created a toolchain for this very CPU using crosstool-ng. When I try to load the compiled binary using the CFE> boot loader on this board with the command load -elf 10.13.51.131:main, I get the following output:
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
Why would it say Invalid ELF file? readelf -h shows me the following info:
$ 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
How do I get the ELF file loaded, I don't even want to run anything yet, it first needs to accept the ELF. I have another ELF that's (supposedly) ready to run compiled with VxWorks but I get the same error using that one, too.
This for a Broadcom reference board for the switch BCM956440.
It looks like your file isn't being transferred (via tftp) correctly, leading to errors when the file is to be parsed as ELF.
Perhaps try running a packet capture on the tftp server, to inspect the traffic between booloader and server. Try something like this on the tftp server:
- then open the resulting
tftp.pcapfile with wireshark.