When using Solaris as, the .loc directives aren't present. Their use is
guarded by dwarf2out.cc (dwarf2out_default_as_loc_support), which
ultimately depends on HAVE_AS_DWARF2_DEBUG_LINE
To avoid this, this patch restricts the scans to gas targets, which is
better than what we currently have.
Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (as and gas),
and x86_64-pc-linux-gnu.