[Mips] Recognize MIPS emulation name 'elf32ltsmip'.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207687 91177308-0d34-0410-b5e6-96231b3b80d8
[Driver] Remove the redundant cast.

No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207688 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Factor out the code builds a library search directory path
into the separate function.

No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207689 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Return result from the function ASAP.

No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207690 91177308-0d34-0410-b5e6-96231b3b80d8
[Driver] Check type of InputElement before request a error message. If the
element is a FileNode, request error description. If the element is Group,
print hard coded error message. We need to implement a better diagnostics
here but even current solution is better than a segmentation fault output.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207691 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Add a test for lib.exe subcommand.

Previously the input file for the lib.exe command would be removed
as soon as the command exits, so we couldn't write a test to check
the file contents are correct.

This patch adds /lldmoduledeffile: option to retain a copy of the
temporary file at the given file path, so that you can see the file
if you want.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207727 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Fix exported symbol name.

When creating a .lib file, we should strip the leading underscore,
but should not strip stdcall atsign suffix. Otherwise produced .lib
files cannot be linked.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207729 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] Follow-up to the r207687. Add the test to check MIPS specific
arguments of the -m command line option.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207738 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] Follow-up to the r207744. Replace numerical e_flags constants by their names.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207745 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Fix the file look up algorithm used in the linker script GROUP command.

In general the linker scripts's GROUP command works like a pair
of command line options --start-group/--end-group. But there is
a difference in the files look up algorithm.

The --start-group/--end-group commands use a trivial approach:
a) If the path has '-l' prefix, add 'lib' prefix and '.a'/'.so'
   suffix and search the path through library search directories.
b) Otherwise, use the path 'as-is'.

The GROUP command implements more compicated approach:
a) If the path has '-l' prefix, add 'lib' prefix and '.a'/'.so'
   suffix and search the path through library search directories.
b) If the path does not have '-l' prefix, and sysroot is configured,
   and the path starts with the / character, and the script being
   processed is located inside the sysroot, search the path under
   the sysroot. Otherwise, try to open the path in the current
   directory. If it is not found, search through library search
   directories.

https://www.sourceware.org/binutils/docs-2.24/ld/File-Commands.html

The patch reviewed by Shankar Easwaran, Rui Ueyama.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207769 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Do not call addDllExport to mutate export descriptors.

This is more efficient than before.

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


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

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207802 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Drop stdcall's atsign suffix only.

You can omit @number suffix when specifying /export option,
but you can do that only for stdcall functions.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207809 91177308-0d34-0410-b5e6-96231b3b80d8
Make the variable scope narrower. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207821 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Support =internalName syntax in .def file.

Export definitions in a module definition file is as follows:

  exportedname[=internalname] [@ordinal [NONAME]] [PRIVATE] [DATA]

Previously we did not support =internalname, so users couldn't export
symbols from a DLL with a different name.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207827 91177308-0d34-0410-b5e6-96231b3b80d8
Don't use "auto" where the actual type is not obvious.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@207875 91177308-0d34-0410-b5e6-96231b3b80d8
Return the expression result directly.

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