summaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-09-28 22:56:41 +0930
committerAlan Modra <amodra@gmail.com>2022-09-28 23:01:56 +0930
commite2bae06cf91bd6d505705432eebc32cb246a690b (patch)
treede374c57a3d4854654200ec673eb1daa11a2bb31 /binutils
parent93362ef59ee13aa8ec7c09897c00e15f3ce38b7b (diff)
downloadbinutils-gdb-e2bae06cf91bd6d505705432eebc32cb246a690b.tar.gz
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.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/embedspu.sh6
1 files changed, 1 insertions, 5 deletions
diff --git a/binutils/embedspu.sh b/binutils/embedspu.sh
index 361206f7d88..d72773946c2 100644
--- a/binutils/embedspu.sh
+++ b/binutils/embedspu.sh
@@ -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