Adjust the driver to invoke the linker more similar to gcc. -dynamic-linker is
only passed if -static and -shared are not part of the compiler (driver)
invocation. Replicate the passing of -export-rdynamic as per the GCC link spec:
%{!static: %{rdynamic:-export-dynamic} %{!shared:-dynamic-linker ...}}
This behaviour is consistent across all the targets that are supported, so no
need to conditionalise it on the target.
Resolves PR24245.
llvm-svn: 260019