svn commit: r312082 - stable/11/sys/tools
Li-Wen Hsu
lwhsu at FreeBSD.org
Fri Jan 13 19:22:24 UTC 2017
Author: lwhsu (ports committer)
Date: Fri Jan 13 19:22:22 2017
New Revision: 312082
URL: https://svnweb.freebsd.org/changeset/base/312082
Log:
MFC r311881:
Replace using of objdump with elfdump
In-tree objdump is too old to dump new ELF headers. But for example if we
use: `make CROSS_TOOLCHAIN=riscv64-gcc TARGET_ARCH=riscv64` and do not specify
CROSS_BINUTILS_PREFIX in env, embed_mfs.sh cannot find the correct objdump.
This patch just replaces using of objdump with elfdump to collect needed
information.
Later we may also put an ELFDUMP in CROSSENV and use it in embed_mfs.sh .
Reviewed by: emaste, br
Differential Revision: https://reviews.freebsd.org/D9062
Modified:
stable/11/sys/tools/embed_mfs.sh
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/tools/embed_mfs.sh
==============================================================================
--- stable/11/sys/tools/embed_mfs.sh Fri Jan 13 18:36:46 2017 (r312081)
+++ stable/11/sys/tools/embed_mfs.sh Fri Jan 13 19:22:22 2017 (r312082)
@@ -36,12 +36,12 @@ mfs_size=`stat -f '%z' $2 2> /dev/null`
# If we can't determine MFS image size - bail.
[ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1
-sec_info=`objdump -h $1 2> /dev/null | grep " oldmfs "`
+sec_info=`elfdump -c $1 2> /dev/null | grep -A 5 -E "sh_name: oldmfs$"`
# If we can't find the mfs section within the given kernel - bail.
[ -z "${sec_info}" ] && echo "Can't locate mfs section within kernel" && exit 1
-sec_size=`echo ${sec_info} | awk '{printf("%d", "0x" $3)}' 2> /dev/null`
-sec_start=`echo ${sec_info} | awk '{printf("%d", "0x" $6)}' 2> /dev/null`
+sec_size=`echo "${sec_info}" | awk '/sh_size/ {print $2}' 2> /dev/null`
+sec_start=`echo "${sec_info}" | awk '/sh_offset/ {print $2}' 2> /dev/null`
# If the mfs section size is smaller than the mfs image - bail.
[ ${sec_size} -lt ${mfs_size} ] && echo "MFS image too large" && exit 1
More information about the svn-src-stable
mailing list