[U-Boot] bootelf and 64 bit elf application

Siddharth Tuli tsiddharth at juniper.net
Thu Aug 2 04:06:28 UTC 2018


Hi,

I am trying to use bootelf to load a 64-bit elf binary, but it appears to fail. I tried using the hello_world from U-Boot sources as well.  My U-Boot is based 2015.01 and I have patches applied for 64elf support, and compiled as a 64 bit U-Boot.  Any idea what is need to support bootelf for 64-bit?

<snip>
# file hello_world.bin
hello_world.bin: ELF 64-bit LSB executable, version 1 (SYSV), statically linked, not stripped

uboot#  tftp 0x80300000 tsiddharth/hello_world.bin
*****ethHw_checkPortSpeed setting speed: 5
Using bcmiproc_eth-0 device
TFTP from server 10.204.96.200; our IP address is 10.216.67.182; sending through gateway 10.216.79.254
Filename 'tsiddharth/hello_world.bin'.
Load address: 0x80300000
Loading: #####
         889.6 KiB/s
done
Bytes transferred = 68336 (10af0 hex)
uboot# bootelf -p 0x80300000 <=== I looked at cmd/elf.c and I see that bootelf calls load_elf64_img_phdr() only with ā€œ-pā€ option.
Loading phdr 0 to 0x000000000c100000 (794 bytes)
Loading phdr 1 to 0x0000000000000000 (0 bytes)
## Starting application at 0x0c100000 ...
"Synchronous Abort" handler, esr 0x86000210
ELR:     c100000
LR:      fff4197c
x0 : 0000000000000002 x1 : 00000000feb3f058
x2 : 0000000000000020 x3 : 0000000000000001
x4 : 0000000000000020 x5 : 00000000015087ba
x6 : 00000000ffffffd0 x7 : 0000000000000004
x8 : 0000000000000063 x9 : 000000007af38000
x10: 00000000feaf7678 x11: 00000000fff8c000
x12: 000000000000000f x13: 00000000fffa18c1
x14: 00000000fff99186 x15: 00000000fff99180
x16: 00000000fffa18c1 x17: 00000000fff99175
x18: 00000000feaf7e30 x19: 000000000c100000
x20: 0000000000000000 x21: 00000000feb3f058
x22: 0000000000000002 x23: 0000000000000002
x24: 0000000000000000 x25: 00000000fff912f9
x26: 0000000000000000 x27: 0000000000000000
x28: 0000000000000000 x29: 00000000feaf7b00

Resetting CPU ...

resetting ...

</snip>

Patches applied -

author   Bin Meng <bmeng.cn at gmail.com<mailto:bmeng.cn at gmail.com>>
                Thu, 12 Apr 2018 10:32:14 +0530 (22:02 -0700)
commit  839c4e9c5bb09ac1ef2c129c7082a15b9cbd3a8a
elf: Add a very simple ELF64 loader
This adds a very simple ELF64 loader via program headers, similar
to load_elf_image_phdr() that we already have.

author   Bin Meng <bmeng.cn at gmail.com<mailto:bmeng.cn at gmail.com>>
                Thu, 12 Apr 2018 10:32:13 +0530 (22:02 -0700)
commit  2bce3f595d224fc620b07449d47fa2b08151a890
elf: Add ELF64 related structure defines
This adds ELF header, program header and section header structure
defines for the 64-bit ELF image.

Regards

Siddharth


More information about the U-Boot mailing list