[ELF] Order DT_NEEDED entries by command line order.

With this all test-suite tests pass with lld on x86-64 Linux.
Simplify.
[gnu-ld] Support -m on non-NetBSD targets.