Merge lld trunk r321017 to contrib/llvm/tools/lld. (Note that in this merge, I foolishly combined upstream changes with this local change. But only this ifdef part is really needed, as we always default to ELF link mode.)