#!/bin/bash export LANG= set -e cd "$(dirname "$0")" mold=`pwd`/../../mold echo -n "Testing $(basename -s .sh "$0") ... " t=$(pwd)/../../out/test/elf/$(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