diff options
author | Samuel Holland <samuel@sholland.org> | 2022-07-15 01:40:25 -0500 |
---|---|---|
committer | Michal Simek <michal.simek@amd.com> | 2022-07-26 08:23:54 +0200 |
commit | 5e0e1a86d327d0e3330aee737559dd15a3b27bd7 (patch) | |
tree | 35587760956fd35d974bc7207c0d0cc6623699a9 /drivers/fpga/ivm_core.c | |
parent | 71f07731488e9ade674ee396208317ab2db3cce1 (diff) |
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: 4c9e2d643460 ("tools: relocate-rela: Read rela start/end directly from ELF")
Fixes: a1405d9cfedb ("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>
Diffstat (limited to 'drivers/fpga/ivm_core.c')
0 files changed, 0 insertions, 0 deletions