u-boot/tools
Samuel Holland 5e0e1a86d3 tools: relocate-rela: Fix ELF decoding on big-endian hosts
The new ELF decoding logic assumed that the target binary has the same
endianness as the host, which broke building ARM64 firmware binaries on
big-endian machines.

This commit fixes the ELF64 decoding to be host-endianness-neutral, and
applies the same changes to the ELF32 decoding. It does not fix the
microblaze-specific dynamic symbol decoding.

It also corrects the functions used for byte swapping in rela_elf64()
and rela_elf32(). The result is the same, but semantically the code is
converting bytes read from a foreign-endianness file to host byte order.

Fixes: 4c9e2d6434 ("tools: relocate-rela: Read rela start/end directly from ELF")
Fixes: a1405d9cfe ("tools: relocate-rela: Check that relocation works only for EM_AARCH64")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20220715064026.54551-1-samuel@sholland.org
Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-07-26 08:23:54 +02:00
..
binman spl: binman: Check at runtime if binman symbols were filled in 2022-06-28 03:09:52 +01:00
buildman patman: test_util: Use unittest text runner to print test results 2022-06-28 03:09:51 +01:00
concurrencytest patman: test_util: Print test stdout/stderr within test summaries 2022-06-28 03:09:51 +01:00
docker nds32: Remove the architecture 2022-04-25 16:04:05 -04:00
dtoc dm: core: Support accessing core tags 2022-06-28 03:09:52 +01:00
env fw_env: add fallback to Linux's NVMEM based access 2022-07-08 09:06:57 -04:00
gdb
kermit
libfdt
logos video: theadorable: Use RGB565 for BMP blitting 2021-12-26 23:23:52 +01:00
omap
patman patman: Fix defaults not propagating to subparsers 2022-06-28 03:09:51 +01:00
scripts
.gitignore tools: add boot/ to .gitignore 2022-04-19 14:51:11 -04:00
aisimage.c
aisimage.h
asn1_compiler.c WS cleanup: remove trailing white space 2021-09-30 08:08:56 -04:00
atmel_pmecc_params.c
atmelimage.c
bmp_logo.c
default_image.c
dumpimage.c tools: mkimage/dumpimage: Allow to use -l with -T 2022-02-28 10:33:11 -05:00
dumpimage.h
eficapsule.h mkeficapsule: Remove raw and FIT GUID types 2022-04-15 10:43:18 +02:00
efivar.py tools: efivar.py unused variable 2021-01-13 02:38:00 +01:00
endian-swap.py
envcrc.c
fdt_host.h tools: Improve comments in signing functions 2022-01-26 08:50:43 -07:00
fdtgrep.c fdtgrep: Correct alignment of struct section 2021-12-17 09:44:59 -07:00
file2include.c
fit_check_sign.c fit_check_sign: Update help to mention the key is in a dtb 2022-01-26 08:50:42 -07:00
fit_common.c tools: mkimage: Show where signatures/keys are written 2022-01-26 08:50:44 -07:00
fit_common.h tools: mkimage: Show where signatures/keys are written 2022-01-26 08:50:44 -07:00
fit_image.c mkimage: Support signing 'auto' FITs 2022-06-06 18:01:20 -04:00
fit_info.c
gen_eth_addr.c
gen_ethaddr_crc.c
genboardscfg.py Revert "global: Remove CONFIG_SYS_EXTRA_OPTIONS support" 2022-04-02 18:18:57 -04:00
getline.c
getline.h
gpheader.h
gpimage-common.c
gpimage.c
ifdtool.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
ifdtool.h
ifwitool.c
image-host.c tools: mkimage: Avoid ENODATA in host tools 2022-05-05 19:37:11 -04:00
image-sig-host.c rsa: adds rsa3072 algorithm 2022-01-28 17:58:41 -05:00
imagetool.c tools/imagetool: Fix segfault when tparams->verify_header is NULL 2022-05-05 15:06:02 -04:00
imagetool.h mkimage: Support signing 'auto' FITs 2022-06-06 18:01:20 -04:00
img2srec.c
imx8image.c tools: imx image: fix write warning 2021-04-08 09:18:29 +02:00
imx8m_image.sh tools: imx8m_image: Support ddr3 firmware 2021-10-21 13:59:26 +02:00
imx8mimage.c tools: imx8mimage: not abort when mmap fail 2021-10-07 17:45:00 +02:00
imx_cntr_image.sh
imximage.c tools/imximage: fix DCD Blocks message output order 2020-08-18 10:10:25 +02:00
jtagconsole
k3_fit_atf.sh tools: k3_fit_atf: Fix DM binary FIT load addresses 2021-09-10 20:10:20 -04:00
k3_gen_x509_cert.sh k3_gen_x509_cert: Make SWRV configurable for anti-rollback protection 2022-07-25 14:57:27 -04:00
Kconfig tools: build mkeficapsule with tools-only_defconfig 2022-02-11 20:07:55 +01:00
kwbimage.c tools: kwbimage: Add me as an author of kwbimage 2022-02-17 14:17:07 +01:00
kwbimage.h tools: kwbimage: Add support for dumping extended and binary v0 headers 2022-02-17 14:17:07 +01:00
kwboot.c treewide: Fix Marek's name and change my e-mail address 2022-07-21 10:14:04 +02:00
lpc32xximage.c
Makefile crc16-ccitt: Rename file with CRC-16-CCITT implementation to crc16-ccitt.c 2022-04-21 14:32:40 -04:00
microcode-tool
microcode-tool.py
mips-relocs.c linker_lists: Rename sections to remove . prefix 2022-06-23 12:58:18 -04:00
mkeficapsule.c mkeficapsule: Remove raw and FIT GUID types 2022-04-15 10:43:18 +02:00
mkenvimage.c
mkexynosspl.c
mkimage.c mkimage: Add long options 2022-07-13 20:05:49 +02:00
mkimage.h image: fit: Use stack allocation macro 2022-07-01 16:01:25 -04:00
mksunxiboot.c tools: mksunxiboot: Use sunxi_image header directly 2021-10-25 14:49:58 +01:00
moveconfig.py Revert "global: Remove CONFIG_SYS_EXTRA_OPTIONS support" 2022-04-02 18:18:57 -04:00
mtk_image.c tools: mtk_image: add support for MT7621 NAND images 2022-07-13 23:03:37 +02:00
mtk_image.h tools: mtk_image: add support for MT7621 NAND images 2022-07-13 23:03:37 +02:00
mxsboot.c
mxsimage.c tools/mxsimage: Remove fclose on empty FILE pointer 2022-02-05 13:38:39 +01:00
mxsimage.h
ncb.c
netconsole tools/netconsole: Add support for socat 2021-12-02 08:34:01 +02:00
omapimage.c
omapimage.h
os_support.c
os_support.h
pbl_crc32.c
pbl_crc32.h
pblimage.c tools: pblimage: fix image header verification function 2022-02-28 12:01:02 +05:30
pblimage.h tools: pblimage: fix image header verification function 2022-02-28 12:01:02 +05:30
prelink-riscv.c
prelink-riscv.inc
proftool.c
relocate-rela.c tools: relocate-rela: Fix ELF decoding on big-endian hosts 2022-07-26 08:23:54 +02:00
rkcommon.c rockchip: tools: add rk3066 support to rkcommon.c 2022-04-18 11:25:13 +08:00
rkcommon.h doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
rkimage.c
rkmux.py
rksd.c
rkspi.c
rmboard.py patman: Convert camel case in command.py 2022-02-09 12:26:12 -07:00
socfpgaimage.c tools: socfpgaimage: update padding flow 2021-01-15 17:48:39 +08:00
spl_size_limit.c
stm32image.c
sunxi-spl-image-builder.c
sunxi_egon.c mkimage: sunxi_egon: add support for riscv 2022-04-04 23:24:17 +01:00
sunxi_toc0.c tools: mkimage: set OPENSSL_API_COMPAT 2022-05-07 23:17:25 +02:00
termios_linux.h treewide: Fix Marek's name and change my e-mail address 2022-07-21 10:14:04 +02:00
ublimage.c
ublimage.h
ubsha1.c
update_octeon_header.c mips: octeon: tools: Add update_octeon_header tool 2020-11-30 18:32:09 +01:00
vybridimage.c
xway-swap-bytes.c
zynqimage.c
zynqmp_pm_cfg_obj_convert.py tools/zynqmp_pm_cfg_obj_convert.py: fix build with Vivado 2021.x 2022-02-15 12:41:00 +01:00
zynqmp_psu_init_minimize.sh tools: zynqmp_psu_init_minimize: Move helper functions below header includes 2022-06-24 14:37:27 +02:00
zynqmpbif.c
zynqmpimage.c
zynqmpimage.h