aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/ModuleManager.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-06-20 07:21:57 +0000
committerRui Ueyama <ruiu@google.com>2015-06-20 07:21:57 +0000
commitefb7e1aa2988079c4a65effbe3d9391f875b4561 (patch)
treeafaf0f54aaeb73edbf9485037377be83810cb18c /clang/lib/Serialization/ModuleManager.cpp
parent4c548f2dd9b2673e9bf132a6bd4092165af0e3c0 (diff)
downloadllvm-efb7e1aa2988079c4a65effbe3d9391f875b4561.zip
llvm-efb7e1aa2988079c4a65effbe3d9391f875b4561.tar.gz
llvm-efb7e1aa2988079c4a65effbe3d9391f875b4561.tar.bz2
COFF: Fix a common symbol bug.
This is a case that one mistake caused a very mysterious bug. I made a mistake to calculate addresses of common symbols, so each common symbol pointed not to the beginning of its location but to the end of its location. (Ouch!) Common symbols are aligned on 16 byte boundaries. If a common symbol is small enough to fit between the end of its real location and whatever comes next, this bug didn't cause any harm. However, if a common symbol is larger than that, its memory naturally overlapped with other symbols. That means some uninitialized variables accidentally shared memory. Because totally unrelated memory writes mutated other varaibles, it was hard to debug. It's surprising that LLD was able to link itself and all LLD tests except gunit tests passed with this nasty bug. With this fix, the new COFF linker is able to pass all tests for LLVM, Clang and LLD if I use MSVC cl.exe as a compiler. Only three tests are failing when used with clang-cl. llvm-svn: 240216
Diffstat (limited to 'clang/lib/Serialization/ModuleManager.cpp')
0 files changed, 0 insertions, 0 deletions