summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorOvidiu Panait <ovpanait@gmail.com>2023-03-11 19:38:34 +0200
committerMichal Simek <michal.simek@amd.com>2023-03-13 11:46:17 +0100
commit26c8c1bd12617aab0480d0a559194e4e0631e637 (patch)
tree0f496f69c9fe27a3fdcec2b5cc850a874b873b0b /tools
parentebea05e10ea8d838163273ebb4f538febc299cce (diff)
downloadu-boot-26c8c1bd12617aab0480d0a559194e4e0631e637.tar.gz
u-boot-26c8c1bd12617aab0480d0a559194e4e0631e637.tar.bz2
u-boot-26c8c1bd12617aab0480d0a559194e4e0631e637.zip
tools: relocate-rela: adjust le64_to_cpu -> le32_to_cpu in decode_elf32()
The sh_addr/sh_offset/sh_size fields in Elf32_Shdr are 32-bits wide, so use le32_to_cpu() instead of the 64-bit variant. Fixes: 5e0e1a86d327 ("tools: relocate-rela: Fix ELF decoding on big-endian hosts") Reviewed-by: Michal Simek <michal.simek@amd.com> Signed-off-by: Ovidiu Panait <ovpanait@gmail.com> Link: https://lore.kernel.org/r/20230311173838.521804-1-ovpanait@gmail.com Signed-off-by: Michal Simek <michal.simek@amd.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/relocate-rela.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/relocate-rela.c b/tools/relocate-rela.c
index 2d2a2ed277..689e2d4655 100644
--- a/tools/relocate-rela.c
+++ b/tools/relocate-rela.c
@@ -316,9 +316,9 @@ static int decode_elf32(FILE *felf, char **argv)
debug("%s\n", sh_name);
- sh_addr = le64_to_cpu(sh_table[i].sh_addr);
- sh_offset = le64_to_cpu(sh_table[i].sh_offset);
- sh_size = le64_to_cpu(sh_table[i].sh_size);
+ sh_addr = le32_to_cpu(sh_table[i].sh_addr);
+ sh_offset = le32_to_cpu(sh_table[i].sh_offset);
+ sh_size = le32_to_cpu(sh_table[i].sh_size);
if (!strcmp(".rela.dyn", sh_name)) {
debug("Found section\t\".rela_dyn\"\n");