hanchenye-llvm-project/lld
Rui Ueyama 140f6029ce [PECOFF] Fix section header.
The PE/COFF spec says that SizeOfRawData field in the section
header must be a multiple of FileAlignment from the optional
header. LLD emits 512 as FileAlignment, so it must have been
a multiple of 512.

LLD did not follow that. It emitted the actual section size
without the last padding as the SizeOfRawData. Although it's
not correct as per the spec, the Windows loader doesn't seem
to actually bother to check that. Executables created by LLD
worked fine.

However, tools dealing with executalbe files may expect it
to be the correct value, and one instance of it is mt.exe
tool distributed as a part of Windows SDK.

If CMake is invoked with "-E vs_link_exe" option, it silently
run mt.exe to embed a resource file to the resulting file.
And mt.exe sometimes breaks an input file if it's section
header does not follow the standard. That caused a misterous
error that CMake with Ninja occasionally produces a broken
executable.

This patch fixes the section header to make mt.exe and
other tools happy.

llvm-svn: 214453
2014-07-31 22:40:35 +00:00
..
cmake/modules Add VTune as an optional external dependency and add task tracking. 2013-04-06 00:56:40 +00:00
docs Remove group-parent references. 2014-06-03 03:07:49 +00:00
include [mach-o] Add support for -sectalign option 2014-07-30 00:58:06 +00:00
lib [PECOFF] Fix section header. 2014-07-31 22:40:35 +00:00
test [PECOFF] Fix section header. 2014-07-31 22:40:35 +00:00
tools Initial set of Makefiles 2014-06-04 09:54:07 +00:00
unittests [PECOFF] Add /profile command line option. 2014-07-25 22:28:49 +00:00
utils Update for llvm api change. 2014-07-06 17:43:22 +00:00
.arcconfig Update Phabricator server. 2014-04-07 04:52:24 +00:00
.clang-format Remove redundant "Standard: Cpp11" tag. The LLVM style has used the 2014-07-04 12:08:03 +00:00
.gitignore Update .gitignore to ignore hidden MacOSX Finder droppings 2014-07-16 21:01:17 +00:00
CMakeLists.txt Add support for building Sphinx documentation when being built inside LLVM source tree and using CMake. 2014-04-18 21:59:05 +00:00
LICENSE.TXT Update the copyright credits -- Happy new year 2014! 2014-01-01 08:27:31 +00:00
Makefile Initial set of Makefiles 2014-06-04 09:54:07 +00:00
README.md

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.