[PECOFF] Fix DLLCharacteristics field.

IMAGE_DLL_CHARACTERISTICS_NO_SEH flag should be set only when SEH is disabled.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202215 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Add a utility function to add DIR32 relocation.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202217 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Declare cmake_minimum_required() unconditionally.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202235 91177308-0d34-0410-b5e6-96231b3b80d8
lldReaderWriter: move LLVM_LINK_COMPONENTS. It seems Subdirectories don't depend on LLVMObject.

Please give LLVMObject explicitly in each subdirectory if any of subdirectories required it.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202236 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Introduce cmake_policy(CMP0022) for target_link_libraries(INTERFACE|PRIVATE).

For now, use both keywords, INTERFACE and PRIVATE via the variable,
  - ${cmake_2_8_12_INTERFACE}
  - ${cmake_2_8_12_PRIVATE}

They could be cleaned up when we introduce 2.8.12.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202239 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Use target_link_libraries(INTERFACE|PRIVATE) on CMake-2.8.12 to increase opportunity for parallel build.

target_link_libraries(INTERFACE) doesn't bring inter-target dependencies in add_library,
although final targets have dependencies to whole dependent libraries.
It makes most libraries can be built in parallel.

target_link_libraries(PRIVATE) is used to shaared library.
Each dependent library is linked to the target.so, and its user will not see its grandchildren.
For example,

  - libclang.so has sufficient libclang*.a(s).
  - c-index-test requires just only libclang.so.

FIXME: lld is tweaked minimally. Adding INTERFACE in each library would be better thing.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202241 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Emit Load Configuration and SEH Table for x86.

If all input files are compatible with Structured Exception Handling, linker
is supposed to create an exectuable with a table for SEH handlers. The table
consists of exception handlers entry point addresses.

The basic idea of SEH in x86 Microsoft ABI is to list all valid entry points
of exception handlers in an read-only memory, so that an attacker cannot
override the addresses in it. In x86 ABI, data for exception handling is mostly
on stack, so it's volnerable to stack overflow attack. In order to protect
against it, Windows runtime uses the table to check a return address, to
ensure that the address is really an valid entry point for an exception handler.

Compiler emits a list of exception handler functions to .sxdata section. It
also emits a marker symbol "@feat.00" to indicate that the object is compatible
with SEH. SEH is a relatively new feature for COFF, and mixing SEH-compatible
and SEH-incompatible objects will result in an invalid executable, so is the
marker.

If all input files are compatible with SEH, LLD emits a SEH table. SEH table
needs to be pointed by Load Configuration strucutre, so when emitting a SEH
table LLD emits it too. The address of a Load Configuration will be stored to
the file header.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202248 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] Exit from the class method as soon as possible.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202287 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] Use a correct number of bits when apply result of calculated relocation.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202288 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] Split reloc26 function into two parts - for processing local and
external relocations.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202289 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] Remove non-ASCII symbol from the comment.

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

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202314 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Add a test for /SAFESEH:NO for non-x86 machine type.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202322 91177308-0d34-0410-b5e6-96231b3b80d8
[Hexagon] Rename the header file.

This is to accomodate future changes for newer revisions of the DSP.

No change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202350 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Set "Exception Table" field in PE32+ header.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202527 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Sort SEH table entries according to its value.

It looks like the contents of the table need to be sorted according to its
value, so that the runtime can find the entry by binary search. I'm not 100%
sure if we really have to do that, but at least I can say it's safe to do
because the contents of .sxdata is just a list of exception handlers' RVAs.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202550 91177308-0d34-0410-b5e6-96231b3b80d8
[C++1y] Don't error if the user is enabling C++1y, which is *newer* than
C++11. I'm not sure that this is a good idea, but I know some crazy
folks on the core working group who like to live dangerously, and they
should still be able to build LLD. =D

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202568 91177308-0d34-0410-b5e6-96231b3b80d8
[C++11] Update LLD documentation to just refer to the LLVM documentation
for C++11 issues.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202623 91177308-0d34-0410-b5e6-96231b3b80d8
[C++11] Switch from LLVM_FINAL to just "final" now that all of LLVM is
requiring MSVC 2012 or newer.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@202626 91177308-0d34-0410-b5e6-96231b3b80d8
[C++11] Replace LLVM_OVERRIDE with just "override" now that we're all
using MSVC 2012 or newer.

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