[lld] r220259 - [PECOFF] Look for decorated entry symbol name.
Rui Ueyama
ruiu at google.com
Mon Oct 20 19:28:28 PDT 2014
Author: ruiu
Date: Mon Oct 20 21:28:28 2014
New Revision: 220259
URL: http://llvm.org/viewvc/llvm-project?rev=220259&view=rev
Log:
[PECOFF] Look for decorated entry symbol name.
Entry symbol name can be decorated. When we look for _WinMain, we
also have to look for _WinMain at 16.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h
lld/trunk/test/pecoff/entry.test
Modified: lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h?rev=220259&r1=220258&r2=220259&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h Mon Oct 20 21:28:28 2014
@@ -337,7 +337,11 @@ private:
// Returns true if a given name exists in an input object file.
auto defined = [&](StringRef name) -> bool {
- return _syms->defined().count(_ctx->decorateSymbol(name));
+ StringRef sym = _ctx->decorateSymbol(name);
+ if (_syms->defined().count(sym))
+ return true;
+ std::string ignore;
+ return findDecoratedSymbol(_ctx, _syms.get(), sym, ignore);
};
switch (_ctx->getSubsystem()) {
Modified: lld/trunk/test/pecoff/entry.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/entry.test?rev=220259&r1=220258&r2=220259&view=diff
==============================================================================
--- lld/trunk/test/pecoff/entry.test (original)
+++ lld/trunk/test/pecoff/entry.test Mon Oct 20 21:28:28 2014
@@ -17,6 +17,9 @@ WMAIN: _wmainCRTStartup
# RUN: not lld -flavor link /out:%t.exe /alternatename:_WinMain=_foo \
# RUN: -- %t.obj 2> %t.log
# RUN: FileCheck -check-prefix=WINMAIN %s < %t.log
+# RUN: not lld -flavor link /out:%t.exe /alternatename:_WinMain at 16=_foo \
+# RUN: -- %t.obj 2> %t.log
+# RUN: FileCheck -check-prefix=WINMAIN %s < %t.log
WINMAIN: _WinMainCRTStartup
More information about the llvm-commits
mailing list