These 2 patches are from upstream binutils and together properly
detect whether -ldl is necessary and available to build ld and gold
in plugins mode, instead of hard-coding its usage always. This lets
us build ld and gold on *bsd and minix systems, which do not have
or need -ldl for dl*() functions.
Change-Id: Ie21d027f5d7c225edc9e6e0c6fa2e4b34f421415