summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ItaniumMangle.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-07-02 03:15:15 +0000
committerRui Ueyama <ruiu@google.com>2015-07-02 03:15:15 +0000
commit85225b0a367a488df4920caf3d11c6b04754891b (patch)
treec5d7a2a3fb7489d776324cee5213095cdb706437 /clang/lib/AST/ItaniumMangle.cpp
parentbbb2e8234c4521da4e939943bca0e0d9c7c34791 (diff)
downloadbcm5719-llvm-85225b0a367a488df4920caf3d11c6b04754891b.tar.gz
bcm5719-llvm-85225b0a367a488df4920caf3d11c6b04754891b.zip
COFF: Infer entry point as early as possible, but not too early.
On Windows, we have four different main functions, {w,}{main,WinMain}. The linker has to choose a corresponding entry point function among {w,}{main,WinMain}CRTStartup. These entry point functions are defined in the standard library. The linker resolves one of them by looking at which main function is defined and adding a corresponding undefined symbol to the symbol table. Object files containing entry point functions conflicts each other. For example, we cannot resolve both mainCRTStartup and WinMainCRTStartup because other symbols defined in the files conflict. Previously, we inferred CRT function name at the very end of name resolution. I found that that is sometimes too late. If the linker already linked one of these four archive member objects, it's too late to change the decision. The right thing to do here is to infer entry point name after adding all symbols from command line files and before adding any other files (which are specified by directive sections). This patch does that. llvm-svn: 241236
Diffstat (limited to 'clang/lib/AST/ItaniumMangle.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud