forked from OSchip/llvm-project
495a031ce4
I hope this is the last fix for x64 relocations as I've wasted a few days on this. This caused a mysterious issue that some C++ programs crash on startup. It was because a null pointer is passed as argv to main. __tmainCRTStartup calls main, but before that it calls all initialization routines between .text$xc_a and .text$xc_z. pre_cpp_init is one of such routines, and it is the one who initializes a heap pointer for argv for later use. That routine was not called for some reason. It turned out that __tmainCRTStartup was skipping a block of code because of the relocation bug. A condition in the function depends on a memory load, and that memory load was referring a wrong location. As a result a jump instruction took the wrong branch, skipping pre_cpp_init and so on. This patch fixes the issue. Also added more tests to fix them once and for all. llvm-svn: 216772 |
||
---|---|---|
.. | ||
cmake/modules | ||
docs | ||
include | ||
lib | ||
test | ||
tools | ||
unittests | ||
utils | ||
.arcconfig | ||
.clang-format | ||
.gitignore | ||
CMakeLists.txt | ||
LICENSE.TXT | ||
Makefile | ||
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.