#!/bin/bash set -e mold=$1 cd $(dirname $0) echo -n "Testing $(basename -s .sh $0) ... " t=$(pwd)/tmp/$(basename -s .sh $0) mkdir -p $t cat < $t/log grep -Pq '.note.bar\s+NOTE.+000008 00 A 0 0 4' $t/log grep -Pq '.note.baz\s+NOTE.+000008 00 A 0 0 8' $t/log grep -Pq '.note.nonalloc\s+NOTE.+000008 00 0 0 1' $t/log readelf --segments $t/exe > $t/log fgrep -q '01 .note.bar' $t/log fgrep -q '02 .note.baz .note.foo' $t/log echo OK