Re: egrep in binutils

Multi-line patterns for grep are not supported on some old versions
of grep.

binutils/
	* embedspu.sh: Replace multi-line grep with sed.
ld/
	* testsuite/ld-elfvers/vers.exp: Replace multi-line grep with sed.
This commit is contained in:
Alan Modra
2022-09-28 22:56:41 +09:30
parent 93362ef59e
commit e2bae06cf9
2 changed files with 2 additions and 8 deletions

View File

@@ -108,11 +108,7 @@ main ()
READELF="$prog"
# Sanity check the input file
match="Class:.*ELF32
Type:.*EXEC
Machine:.*SPU
Machine:.*17"
if test `${READELF} -h ${INFILE} | grep "${match}" | wc -l` != 3
if test `${READELF} -h ${INFILE} | sed -n -e '/Class:.*ELF32/p' -e '/Type:.*EXEC/p' -e '/Machine:.*SPU/p' -e '/Machine:.*17/p' | sed -n '$='` != 3
then
echo "${INFILE}: Does not appear to be an SPU executable"
exit 1