[Mips] Do not hard-code the paired relocation type

Request `getPairRelocation()` function to get paired relocation type.
That allows us to look up another pairs like R_MICROMIPS_HI16/LO16
in the future.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@221539 91177308-0d34-0410-b5e6-96231b3b80d8
Fix FileArchive member MemoryBuffer early destruction

When FileArchive loads a member, it instantiates a temporary MemoryBuffer
which points to the member range of the archive file.  The problem is that the
object file parsers call getBufferIndentifer() on that temporary MemoryBuffer
and store that StringRef as the _path data member for that lld::File.  When
FileArchive::instantiateMember() goes out of scope the MemoryBuffer is deleted
and the File::._path becomes a dangling reference.

The fix adds a vector<> to FileArchive to own the instantiated MemoryBuffers.
In addition it fixes member's path to be the standard format
(e.g. "/path/libfoo.a(foo.o)") instead of just the leaf name.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@221544 91177308-0d34-0410-b5e6-96231b3b80d8
[mach-o] Add support for -order_file option

The darwin linker lets you rearrange functions and data for better locality
(less paging).  You do this with the -order_file option which supplies a text
file containing one symbol per line.

Implementing this required a small change to LayoutPass to add a custom sorter
hook.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@221545 91177308-0d34-0410-b5e6-96231b3b80d8
[mach-o] Fix MachOFileNode to own archives same as ELFFileNode

My previous fix to have FileArchive own the member MemoryBuffers was not a
complete solution for darwin because nothing owned the FileArchive object.
Fixed MachOFileNode to be like ELFFileNode and have the graph node own the
archive object.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@221552 91177308-0d34-0410-b5e6-96231b3b80d8
[mach-o] remove stray debug output

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@221553 91177308-0d34-0410-b5e6-96231b3b80d8