tools: relocate-rela: Read rela start/end directly from ELF
There is no need to pass section information via parameters.
Let's read text base and rela start/end directly from elf.
It will help with reading other information from ELF for others
architecture. Input to relocate-rela is u-boot binary and u-boot ELF.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ab7ae14a6e058722e8c608089729e98edf20a08d.1655299267.git.michal.simek@amd.com
diff --git a/Makefile b/Makefile
index 2270ec5..55c55db 100644
--- a/Makefile
+++ b/Makefile
@@ -925,9 +925,7 @@
# $(2) is u-boot ELF, $(3) is u-boot bin, $(4) is text base
quiet_cmd_static_rela = RELOC $@
cmd_static_rela = \
- start=$$($(NM) $(2) | grep __rel_dyn_start | cut -f 1 -d ' '); \
- end=$$($(NM) $(2) | grep __rel_dyn_end | cut -f 1 -d ' '); \
- tools/relocate-rela $(3) $(4) $$start $$end
+ tools/relocate-rela $(3) $(2)
else
quiet_cmd_static_rela =
cmd_static_rela =