#!/bin/bash set -e cd $(dirname $0) echo -n "Testing $(basename -s .sh $0) ... " t=$(pwd)/tmp/$(basename -s .sh $0) mkdir -p $t cat < $t/log grep -q 'Entry point address:.*0x201000' $t/log ../mold -e bar -static -o $t/exe $t/a.o readelf -e $t/exe > $t/log grep -q 'Entry point address:.*0x201008' $t/log ../mold -static -o $t/exe $t/a.o readelf -e $t/exe > $t/log grep -q 'Entry point address:.*0x201000' $t/log echo OK