#!/bin/sh

set -e
set -u

cmd=/usr/bin/sunld

while [ $# -ne 0 ]; do
    case "$1" in
        # GCC with GNU ld passes -m <emulation>,
        # Sun ld does not need it, and -m options has different meaning:
        -m) shift || true;;

        # Ignore long options, Sun ld does not support long options at all:
        --*) ;;

        *) cmd="$cmd $1" ;;
    esac
    shift || true
done

# Trace:
set -x
exec $cmd

exit 0