llvm-project/lld
Rui Ueyama 2e09d93f74 [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.

llvm-svn: 202248
2014-02-26 08:27:59 +00:00
..
cmake/modules Add VTune as an optional external dependency and add task tracking. 2013-04-06 00:56:40 +00:00
docs Fix trailing whitespace. 2014-01-27 03:09:26 +00:00
include/lld [LinkerScript] parse OUTPUT_FORMAT : treat quotedStrings as identifier 2014-02-25 17:02:54 +00:00
lib [PECOFF] Emit Load Configuration and SEH Table for x86. 2014-02-26 08:27:59 +00:00
test [PECOFF] Emit Load Configuration and SEH Table for x86. 2014-02-26 08:27:59 +00:00
tools Make Driver::link and LinkingContext::validate return true on success. 2013-09-24 23:26:34 +00:00
unittests [PECOFF] Driver support for /SAFESEH option. 2014-02-21 22:30:43 +00:00
utils Add basic linker script parsing. 2013-03-01 00:03:36 +00:00
.arcconfig Add .arcconfig for Phabricator command-line support 2013-01-03 02:15:37 +00:00
.clang-format Add .clang-format file to ensure C++11 LLVM coding style. 2013-12-11 22:39:33 +00:00
.gitignore docs: Sketch Sphinx based docs structure. 2012-04-06 21:02:20 +00:00
CMakeLists.txt [CMake] Introduce cmake_policy(CMP0022) for target_link_libraries(INTERFACE|PRIVATE). 2014-02-26 06:45:11 +00:00
LICENSE.TXT Update the copyright credits -- Happy new year 2014! 2014-01-01 08:27:31 +00:00
README.md Test commit 2012-09-14 00:00:39 +00:00

README.md

LLVM Linker (lld)

This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.

lld is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.