tools: relocate-rela: add support for handling 32-bit big endian files
authorOvidiu Panait <ovpanait@gmail.com>
Sat, 11 Mar 2023 17:38:36 +0000 (19:38 +0200)
committerMichal Simek <michal.simek@amd.com>
Mon, 13 Mar 2023 10:46:17 +0000 (11:46 +0100)
commit02d30e5f92d834f020bb7ef6a92ccbf042ed25fc
treeb3630c1963b31558856e22fdd7462ace8983ed15
parent424f04fcd9ab7b2c19521605827e2453dd79c3e2
tools: relocate-rela: add support for handling 32-bit big endian files

Currently, a microblaze build with CONFIG_SYS_BIG_ENDIAN=y and
CONFIG_STATIC_RELA=y fails with:
tools/relocate-rela: Not supported machine type
ELF decoding failed
make[2]: *** [u-boot/Makefile:1306: u-boot-nodtb.bin] Error 1

To fix this, convert the 32-bit codepath to use the previously added
elf{16,32}_to_cpu() functions. The aarch64 codepath is left untouched.

This commit ensures that CI doesn't fail for the next patches which enable
runtime relocation by default for microblaze.

Reviewed-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
Link: https://lore.kernel.org/r/20230311173838.521804-3-ovpanait@gmail.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
tools/relocate-rela.c